Chilkat Online Tools

DataFlex / Plivo REST API / Retrieve all queued calls

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Set ComBasicAuth Of hoHttp To True
    Set ComLogin Of hoHttp To "{{auth_id}}"
    Set ComPassword Of hoHttp To "password"

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateString Of hoQueryParams "status" "queued" To iSuccess

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "https://api.plivo.com/v1/Account/<auth_id>/Call/" vQueryParams To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln iTemp1
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1
    Send Destroy of hoResp


End_Procedure

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