Chilkat Online Tools

autoit / Anypoint Platform APIs / Get all custom policy-templates

Back to Collection Items

; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oHttp = ObjCreate("Chilkat_9_5_0.Http")
Local $bSuccess

$oQueryParams = ObjCreate("Chilkat_9_5_0.JsonObject")
$oQueryParams.UpdateInt("limit",20)
$oQueryParams.UpdateInt("offset",0)

; Adds the "Authorization: Bearer {{token}}" header.
$oHttp.AuthToken = "{{token}}"

Local $oResp = $oHttp.QuickRequestParams("GET","https://domain.com/apimanager/api/v1/organizations/{{organization_id}}/custom-policy-templates",$oQueryParams)
If ($oHttp.LastMethodSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

ConsoleWrite($oResp.StatusCode & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)

Curl Command

curl -G -d "limit=20"
	-d "offset=0"
	-H "Authorization: Bearer {{token}}"
https://domain.com/apimanager/api/v1/organizations/{{organization_id}}/custom-policy-templates

Postman Collection Item JSON

{
  "name": "Get all custom policy-templates",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{token}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{url}}/apimanager/api/v1/organizations/{{organization_id}}/custom-policy-templates?limit=20&offset=0",
      "host": [
        "{{url}}"
      ],
      "path": [
        "apimanager",
        "api",
        "v1",
        "organizations",
        "{{organization_id}}",
        "custom-policy-templates"
      ],
      "query": [
        {
          "key": "limit",
          "value": "20"
        },
        {
          "key": "offset",
          "value": "0"
        }
      ]
    }
  },
  "response": [
  ]
}