All Plivo APIs use HTTP verbs and standard HTTP status codes. To secure requests, all APIs are served over HTTPS.
API Endpoint
https://api.plivo.com/v1/
The current version of the APIs is v1. Server SDKs are versioned as latest and legacy.
Authentication
All requests to Plivo API are authenticated with BasicAuth using your AUTH ID and AUTH TOKEN. Find your credentials on the Plivo console .
Python
Node.js
Ruby
PHP
Java
.NET
Go
cURL
import plivo
client = plivo.RestClient( '<auth_id>' , '<auth_token>' )
Content Type
Plivo only accepts input of type application/json.
POST requests : Arguments must be passed as JSON with Content-Type: application/json
GET and DELETE requests : Arguments must be passed in the query string
Timeouts and Proxies
Server SDKs support specifying timeouts and proxy settings for API requests.
Python
Node.js
Ruby
PHP
.NET
Go
import plivo
proxies = {
'http' : 'https://username:password@proxyurl:proxyport' ,
'https' : 'https://username:password@proxyurl:proxyport'
}
client = plivo.RestClient( '<auth_id>' , '<auth_token>' , proxies = proxies, timeout = 5 )
Plivo uses offset-based pagination to list resources.
Parameter Description limitNumber of results to return. Range: 1-20. Default: 20. offsetNumber of results to skip for pagination.
For example, with 100 results, limit=10 and offset=50 returns objects 51-60.
Asynchronous Requests
All Plivo API requests can be made asynchronous. When an async call is made, Plivo returns a generic response with the api_id, and the actual response is sent to your callback URL.
Parameter Description callback_urlURL to receive the API response. callback_methodHTTP method for the callback. Default: POST.
{
"message" : "async api spawned" ,
"api_id" : "63f0761a-e0ed-11e1-8ea7-12313924e3a6"
}
HTTP Status Codes
Code Description 200Request executed successfully 201Resource created 202Resource changed 204Resource deleted 400Parameter missing or invalid 401Authentication failed 404Resource not found 405HTTP method not allowed 429Too many requests (rate limited) 500Server error
All API responses are in JSON format. Every response includes an api_id to uniquely identify your request.
Field Description api_idUnique identifier for the request. messageInformation about the request result. errorError details if the request failed.
{
"api_id" : "97ceeb52-58b6-11e1-86da-77300b68f8bb" ,
"message" : "call fired" ,
"request_uuid" : "75b26856-8638-11e0-802c-6d99d509954e"
}