Chilkat Online Tools

delphiAx / Plivo REST API / Get an account phone number

Back to Collection Items

var
http: TChilkatHttp;
success: Integer;
sbResponseBody: TChilkatStringBuilder;

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';

sbResponseBody := TChilkatStringBuilder.Create(Self);
success := http.QuickGetSb('https://api.plivo.com/v1/Account/<auth_id>/Number/{number}/',sbResponseBody.ControlInterface);
if (success = 0) then
  begin
    Memo1.Lines.Add(http.LastErrorText);
    Exit;
  end;

Memo1.Lines.Add('Response status code = ' + IntToStr(http.LastStatus));
Memo1.Lines.Add(sbResponseBody.GetAsString());

Curl Command

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

Postman Collection Item JSON

{
  "name": "Get an account phone number",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Number/{number}/",
      "protocol": "https",
      "host": [
        "api",
        "plivo",
        "com"
      ],
      "path": [
        "v1",
        "Account",
        "{{auth_id}}",
        "Number",
        "{number}",
        ""
      ]
    },
    "description": "Get the details of an phone number that you’ve rented from Plivo or [added from your carrier](https://www.plivo.com/docs/numbers/api/incoming-carrier/).\n\nMore information can be found [here](https://www.plivo.com/docs/numbers/api/account-phone-number#retrieve-details-of-a-number)"
  },
  "response": [
  ]
}