Chilkat Online Tools

C++ / Plivo REST API / Hangup all conferences

Back to Collection Items

#include <CkHttp.h>
#include <CkHttpResponse.h>

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

    CkHttp http;
    bool success;

    http.put_BasicAuth(true);
    http.put_Login("{{auth_id}}");
    http.put_Password("password");

    CkHttpResponse *resp = http.QuickRequest("GET","https://api.plivo.com/v1/Account/<auth_id>/Conference/");
    if (http.get_LastMethodSuccess() == false) {
        std::cout << http.lastErrorText() << "\r\n";
        return;
    }

    int respStatusCode = resp->get_StatusCode();
    std::cout << "Response Status Code = " << respStatusCode << "\r\n";
    if (respStatusCode != 204) {
        std::cout << "Response Header:" << "\r\n";
        std::cout << resp->header() << "\r\n";
        std::cout << "Response Body:" << "\r\n";
        std::cout << resp->bodyStr() << "\r\n";
        std::cout << "Failed." << "\r\n";
        delete resp;
        return;
    }

    delete resp;
    std::cout << "Success." << "\r\n";
    }

Curl Command

curl -X GET
	-u '{{auth_id}}:password'
https://api.plivo.com/v1/Account/<auth_id>/Conference/

Postman Collection Item JSON

{
  "name": "Hangup all conferences",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Conference/",
      "protocol": "https",
      "host": [
        "api",
        "plivo",
        "com"
      ],
      "path": [
        "v1",
        "Account",
        "{{auth_id}}",
        "Conference",
        ""
      ]
    },
    "description": "This API lets you hangup all ongoing conferences running on your account.\n\nMore information can be found [here](https://www.plivo.com/docs/voice/api/conference#hangup-all-conferences)"
  },
  "response": [
    {
      "name": "Hangup all conferences",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Conference/",
          "protocol": "https",
          "host": [
            "api",
            "plivo",
            "com"
          ],
          "path": [
            "v1",
            "Account",
            "{{auth_id}}",
            "Conference",
            ""
          ]
        }
      },
      "code": 204,
      "_postman_previewlanguage": "Text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}