Chilkat Online Tools

unicodeC / Plivo REST API / Retrieve all queued calls

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW queryParams;
    HCkHttpResponseW resp;

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

    http = CkHttpW_Create();

    CkHttpW_putBasicAuth(http,TRUE);
    CkHttpW_putLogin(http,L"{{auth_id}}");
    CkHttpW_putPassword(http,L"password");

    queryParams = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(queryParams,L"status",L"queued");

    resp = CkHttpW_QuickRequestParams(http,L"GET",L"https://api.plivo.com/v1/Account/<auth_id>/Call/",queryParams);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(queryParams);
        return;
    }

    wprintf(L"%d\n",CkHttpResponseW_getStatusCode(resp));
    wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
    CkHttpResponseW_Dispose(resp);


    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(queryParams);

    }

Curl Command

curl -G -d "status=queued"
	-u '{{auth_id}}:password'
https://api.plivo.com/v1/Account/<auth_id>/Call/

Postman Collection Item JSON

{
  "name": "Retrieve all queued calls",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Call/?status=queued",
      "protocol": "https",
      "host": [
        "api",
        "plivo",
        "com"
      ],
      "path": [
        "v1",
        "Account",
        "{{auth_id}}",
        "Call",
        ""
      ],
      "query": [
        {
          "key": "status",
          "value": "queued"
        }
      ]
    },
    "description": "This method allows you to retrieve details of all queued calls. The maximum number of results that can be fetched with a single API call is 20.\n\nMore information can be found [here](https://www.plivo.com/docs/voice/api/call#retrieve-all-queued-calls)"
  },
  "response": [
    {
      "name": "Retrieve all queued calls",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Call/?status=queued",
          "protocol": "https",
          "host": [
            "api",
            "plivo",
            "com"
          ],
          "path": [
            "v1",
            "Account",
            "{{auth_id}}",
            "Call",
            ""
          ],
          "query": [
            {
              "key": "status",
              "value": "queued"
            }
          ]
        }
      },
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
      ],
      "cookie": [
      ],
      "body": "{\n    \"api_id\": \"c9527676-5839-11e1-86da-6ff39efcb949\",\n    \"calls\": [\n        \"eac94337-b1cd-499b-82d1-b39bca50dc31\",\n        \"0a70a7fb-168e-4944-a846-4f3f4d2f96f1\"\n    ]\n}"
    }
  ]
}