Chilkat Online Tools

PowerBuilder / Anypoint Platform APIs / Get all applications

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp

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

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_QueryParams = create oleobject
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat_9_5_0.JsonObject")

loo_QueryParams.UpdateString("ascending","true")
loo_QueryParams.UpdateString("filter","all")
loo_QueryParams.UpdateInt("limit",10)
loo_QueryParams.UpdateString("literalMatch","true")
loo_QueryParams.UpdateInt("offset",0)
loo_QueryParams.UpdateString("sort","name")
loo_QueryParams.UpdateString("targetAdminSite","true")

// Adds the "Authorization: Bearer {{token}}" header.
loo_Http.AuthToken = "{{token}}"

loo_Resp = loo_Http.QuickRequestParams("GET","https://domain.com/apiplatform/repository/v2/organizations/{{organization_id}}/applications",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_QueryParams
    return
end if

Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp


destroy loo_Http
destroy loo_QueryParams

Curl Command

curl -G -d "ascending=true"
	-d "filter=all"
	-d "limit=10"
	-d "literalMatch=true"
	-d "offset=0"
	-d "sort=name"
	-d "targetAdminSite=true"
	-H "Authorization: Bearer {{token}}"
https://domain.com/apiplatform/repository/v2/organizations/{{organization_id}}/applications

Postman Collection Item JSON

{
  "name": "Get all applications",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{token}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{url}}/apiplatform/repository/v2/organizations/{{organization_id}}/applications?ascending=true&filter=all&limit=10&literalMatch=true&offset=0&sort=name&targetAdminSite=true",
      "host": [
        "{{url}}"
      ],
      "path": [
        "apiplatform",
        "repository",
        "v2",
        "organizations",
        "{{organization_id}}",
        "applications"
      ],
      "query": [
        {
          "key": "ascending",
          "value": "true"
        },
        {
          "key": "filter",
          "value": "all"
        },
        {
          "key": "limit",
          "value": "10"
        },
        {
          "key": "literalMatch",
          "value": "true"
        },
        {
          "key": "offset",
          "value": "0"
        },
        {
          "key": "sort",
          "value": "name"
        },
        {
          "key": "targetAdminSite",
          "value": "true"
        }
      ]
    }
  },
  "response": [
  ]
}