To send an SMS through our API, you will need to make a HTTP POST request to https://~exotel_sid~:~firstname.lastname@example.org/v1/Accounts/~exotel_sid~/Sms/send
Replace ~exotel_sid~ and ~exotel_token~ with the values you obtain from the Exotel Settings tab of your Exotel portal
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.