Chilkat Online Tools

unicodeCpp / Anypoint Platform APIs / Get all applications

Back to Collection Items

#include <CkHttpW.h>
#include <CkJsonObjectW.h>
#include <CkHttpResponseW.h>

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

    CkHttpW http;
    bool success;

    CkJsonObjectW queryParams;
    queryParams.UpdateString(L"ascending",L"true");
    queryParams.UpdateString(L"filter",L"all");
    queryParams.UpdateInt(L"limit",10);
    queryParams.UpdateString(L"literalMatch",L"true");
    queryParams.UpdateInt(L"offset",0);
    queryParams.UpdateString(L"sort",L"name");
    queryParams.UpdateString(L"targetAdminSite",L"true");

    // Adds the "Authorization: Bearer {{token}}" header.
    http.put_AuthToken(L"{{token}}");

    CkHttpResponseW *resp = http.QuickRequestParams(L"GET",L"https://domain.com/apiplatform/repository/v2/organizations/{{organization_id}}/applications",queryParams);
    if (http.get_LastMethodSuccess() == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    wprintf(L"%d\n",resp->get_StatusCode());
    wprintf(L"%s\n",resp->bodyStr());
    delete resp;
    }

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": [
  ]
}