To send an SMS through our API, you will need to make a HTTP POST request to
<your_api_token>with the API key and token created by you.
<your_sid>with your “Account sid”
<subdomain>with the region of your account
- <subdomain> of Singapore cluster is api.exotel.com
- <subdomain> of Mumbai cluster is api.in.exotel.com
<your_sid> are available in the API settings page of your Exotel Dashboard
The HTTP request, available parameters and sample responses can be viewed on our developer channel.
When there are errors with the SMS submission, the HTTP code will be not 200. Like any good REST API, we give appropriate HTTP codes which give you hints on what type of errors it is and how you can handle it. You can refer here for more details on HTTP codes.
In addition to the HTTP Status code, the body of the SMS contains an XML with the details of the error
The XML (in the HTTP body) is of this form:
<Message>Detailed error message</Message>
The 'Status' is the HTTP code itself again
The 'Message' gives you more details on the error.
Example Status and Messages are below.
|400||Invalid Recipient [xxxx]|
|403||Account is not active|
|403||Insufficient balance to send the SMS|
|403||Account validity has expired|
|429||Too Many Requests|
|500|| Internal Server Error|
NOTE: Do not rely on the "Message" while doing your integration. Always rely only on the HTTP 'Status' code.
SMS Delivery Status:
Please refer here on how to monitor the delivery status of your SMS.
Sample PHP and Java code to send SMS is available at Github
Before you start sending transactional SMS through this API, Please test whether your content is matching a template. Otherwise, the SMS ends up becoming promotional and this causes a lot of confusion.