SMS
How to send SMS using API? (Sending SMS using Postman)
3 min
to send an sms through our api, you will need to make an http post request to https //\<your api key> \<your api token>\<subdomain>/v1/accounts/\<your sid>/sms/send replace \<your api key> and \<your api token> with the api key and token created by you or use the default api and token replace \<your sid> with your “account sid” replace \<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 api key>, \<your api token> and \<your sid> are available on the api settings page of your exotel dashboard the http request, available parameters, and sample responses can be viewed on our developer channel following are the mandatory parameters to be added along with the sms api request \ from specify one of your exophone or the sender id (header) linked to it to mobile number to which sms has to be sent body content (template) of your sms 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 the 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 sample php and java code to send sms is available on 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
🤔
Have a question?
Our knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.