delphiDll / Plivo REST API / List all incoming carriers
Back to Collection Items
var
http: HCkHttp;
success: Boolean;
queryParams: HCkJsonObject;
resp: HCkHttpResponse;
begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http := CkHttp_Create();
CkHttp_putBasicAuth(http,True);
CkHttp_putLogin(http,'{{auth_id}}');
CkHttp_putPassword(http,'password');
queryParams := CkJsonObject_Create();
CkJsonObject_UpdateInt(queryParams,'limit',5);
CkJsonObject_UpdateInt(queryParams,'offset',0);
resp := CkHttp_QuickRequestParams(http,'GET','https://api.plivo.com/v1/Account/<auth_id>/IncomingCarrier/',queryParams);
if (CkHttp_getLastMethodSuccess(http) = False) then
begin
Memo1.Lines.Add(CkHttp__lastErrorText(http));
Exit;
end;
Memo1.Lines.Add(IntToStr(CkHttpResponse_getStatusCode(resp)));
Memo1.Lines.Add(CkHttpResponse__bodyStr(resp));
CkHttpResponse_Dispose(resp);
CkHttp_Dispose(http);
CkJsonObject_Dispose(queryParams);
Curl Command
curl -G -d "limit=5"
-d "offset=0"
-u '{{auth_id}}:password'
https://api.plivo.com/v1/Account/<auth_id>/IncomingCarrier/
Postman Collection Item JSON
{
"name": "List all incoming carriers",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "https://api.plivo.com/v1/Account/{{auth_id}}/IncomingCarrier/?limit=5&offset=0",
"protocol": "https",
"host": [
"api",
"plivo",
"com"
],
"path": [
"v1",
"Account",
"{{auth_id}}",
"IncomingCarrier",
""
],
"query": [
{
"key": "name",
"value": "carrier_name",
"description": "Allows filtering by name",
"disabled": true
},
{
"key": "limit",
"value": "5",
"description": "Used to display the number of results per page. The maximum number of results that can be fetched is 20."
},
{
"key": "offset",
"value": "0",
"description": "Denotes the number of value items by which the results should be offset."
}
]
}
},
"response": [
]
}