Chilkat Online Tools

delphiAx / Plivo REST API / Delete a Specific Recording

Back to Collection Items

var
http: TChilkatHttp;
success: Integer;
resp: IChilkatHttpResponse;
respStatusCode: Integer;

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

http := TChilkatHttp.Create(Self);

http.BasicAuth := 1;
http.Login := '{{auth_id}}';
http.Password := 'password';

resp := http.QuickRequest('DELETE','https://api.plivo.com/v1/Account/<auth_id>/Recording/{recording_id}/');
if (http.LastMethodSuccess = 0) then
  begin
    Memo1.Lines.Add(http.LastErrorText);
    Exit;
  end;

respStatusCode := resp.StatusCode;
Memo1.Lines.Add('Response Status Code = ' + IntToStr(respStatusCode));
if (respStatusCode <> 204) then
  begin
    Memo1.Lines.Add('Response Header:');
    Memo1.Lines.Add(resp.Header);
    Memo1.Lines.Add('Response Body:');
    Memo1.Lines.Add(resp.BodyStr);
    Memo1.Lines.Add('Failed.');

    Exit;
  end;

Memo1.Lines.Add('Success.');

Curl Command

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

Postman Collection Item JSON

{
  "name": "Delete a Specific Recording",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Recording/{recording_id}/",
      "protocol": "https",
      "host": [
        "api",
        "plivo",
        "com"
      ],
      "path": [
        "v1",
        "Account",
        "{{auth_id}}",
        "Recording",
        "{recording_id}",
        ""
      ]
    },
    "description": "This API lets you delete a recording from your Plivo account using the recording ID.\n\nMore information can be found [here](This API lets you delete a recording from your Plivo account using the recording ID.)"
  },
  "response": [
    {
      "name": "Delete a Specific Recording",
      "originalRequest": {
        "method": "DELETE",
        "header": [
        ],
        "url": {
          "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Recording/{recording_id}/",
          "protocol": "https",
          "host": [
            "api",
            "plivo",
            "com"
          ],
          "path": [
            "v1",
            "Account",
            "{{auth_id}}",
            "Recording",
            "{recording_id}",
            ""
          ]
        }
      },
      "code": 204,
      "_postman_previewlanguage": "Text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}