Chilkat Online Tools

PowerBuilder / Plivo REST API / Retrieve all queued calls

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_Http.BasicAuth = 1
loo_Http.Login = "{{auth_id}}"
loo_Http.Password = "password"

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

loo_QueryParams.UpdateString("status","queued")

loo_Resp = loo_Http.QuickRequestParams("GET","https://api.plivo.com/v1/Account/<auth_id>/Call/",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 "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}"
    }
  ]
}