To send an SMS through our API, you will need to make a HTTP POST request to https://~exotel_sid~:~exotel_token~@api.exotel.in/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.


Errors:

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:


<TwilioResponse>
    <RestException>

         <Status>xxx</Status>

         <Message>Detailed error message</Message>

    </RestException>

</TwilioResponse>


The 'Status' is the HTTP code itself again

The 'Message' gives you more details on the error. 


Example Status and Messages are below.


Status Message
400  Invalid Parameters
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.


For a detailed description of these Statues, See Exotel SMS status codes

We Support BULK SMS too.





Need a techie for this integration?
Check our Phone a Friend App
Need sample code?
Check our Github repository for examples