"Currently incoming SMS feature is not available"
Currently, only Outgoing SMS services are available. For Outgoing SMS services, TRAI has made it mandatory to register in the DLT portals. Here are the detailed information: TRAI Regulations on Commercial Communications (DLT portal) - SMS in India
To respond to an Incoming SMS:
There are two use-cases
- UseCase-1: You receive an incoming SMS, and you want to send a dynamic reply to the sender.
- UseCase-2: You receive an incoming SMS and you just want to get details of an incoming SMS at your server - without having to send back a reply SMS.
How to?
- In the Installed apps page, corresponding to your app, click on "Edit SMS app"
- Drag and drop the "Send a Reply" applet into the app you are building.
- In the text box, you can enter a URL (instead of static text).
- When there is an incoming SMS, Exotel will make an HTTP GET request to your web app at the above URL.
- Your web app should respond with the SMS body to send as a reply (See Details Below)
Before the GET request, Exotel will make an HTTP HEAD request to make sure that the URL is indeed returning the correct 'ContentType' as mandated below.
HTTP Request (from Exotel to your URL)
The GET request that Exotel makes to the URL will have the following query parameters:
PARAMETER NAME | VALUE |
---|---|
SmsSid | string, unique identifier of that SMS |
From | string, the number of the sender |
To | string, your Exotel Company number where the SMS was received |
Date | string, Time when the SMS reached Exotel's servers |
Body | string, the contents of the SMS |
Sample HTTP request (if the URL you have entered is http://example.com/exotel.php)
|
HTTP Response (from your Web Server to Exotel)
UseCase-1: If you want to send an SMS back to the SMS-er, your Web Server
- MUST set the Content-Type HTTP header to 'text/plain' and nothing else
- MUST support a HEAD request from Exotel and return the exact same headers that it would for a GET request.
- MUST put the SMS to reply within the HTTP body of the response
Below is a sample HTTP response from your Web Server
|
UseCase-2: If you don't want to send an SMS response back to the sender, your webserver
- MUST set the Content-Length header to 0
- MUST leave the body of the HTTP response empty
GET /path/file.html HTTP/1.0
If you have any questions or concerns, please connect with us using the chat widget on your Exotel Dashboard or Whatsapp us on 08088919888.