REST API Overview
REST APIs power the Communications Platform as a Service (CPaaS) and represent wide range of operations that enable you to create programmable Voice and SMS applications. You can use the REST APIs to create enterprise application that focus on your users needs. The REST APIs are implemented on the HTTP protocol, so you can use them with your preferred programming language and tools.
A REST API client should support the following:
HTTPS and basic authentication
HTTP GET, POST, PUT and DELETE requests
Ability to set and read request and response headers
XML or JSON responses
GET: Lists or reads objects and includes the information needed to perform any Read operations on the object. Sample use: list all of the applications under youraccount.
POST/PUT: Creates or updates objects. Most requests using the POST/PUT method require JSON/XML in the request body. Sample use: modify a Client under youraccount.
DELETE: Removes objects. Sample use: delete an application or client under youraccount.
APIs use basic HTTP authentication to restrict access to API endpoints to authenticated users only. After you sign up with , you can find your Account SID and Auth Token by navigating to
your profile →
Account in the Console.
You then need to use these credentials in your request’s Authorization header using
Basic authentication type (i.e.
Authorization: Basic <base64-encoded AccountSID:AuthToken>). Here’s how you would use an HTTP client to authenticate with :
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID.json \ -u 'YourAccountSid:YourAuthToken'
API resources are accessed via HTTPS requests utilizing UTF-8 format. Data passed to the API through
PUT requests should use urlencoded format (i.e.
Content Type: application/x-www-form-urlencoded).
can return its API responses either in
.xml format depending on the suffix of the url the request was made on. For example a request sent to
will yield a
.json response, while a request sent to
will yield an
SomeAPIs support pagination by accepting as query parameters the page number we interested in as well as the page size. The following query parameters are supported:
Which page of SMS records to return, starting from 0.
Number of records returned per page.
For example, the following request will return the first page of results with a size of 10 items:
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/SMS/Messages.json?Page=0&PageSize=10 \ -u 'YourAccountSid:YourAuthToken'