"Currently incoming SMS feature is not available"


There are two use-cases

  1. UseCase-1: You receive an incoming SMS, and you want to send a dynamic reply to the sender.
  2. 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?

  1. In the Installed apps page, corresponding to your app, click on "Edit SMS app" 
  2. Drag and drop the "Send a Reply" applet in to the app you are building.
  3. In the text box, you can enter a URL (instead of static text). 
  4. When there is an incoming SMS, Exotel will make a HTTP GET request to your web app at the above URL.
  5. Your web app should respond with the SMS body to send as a reply (See Details below)


Before the GET request, Exotel will make a 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 enterd is http://example.com/exotel.php)

GET /exotel.php?SmsSid=xxxxxx&From=9052161119&To=56070&Date=xxxxx&Body=Hello+World  HTTP/1.1



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 with in the HTTP body of the response


Below is a sample HTTP response from your Web Server

HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 130

Thanks for your order inquiry through SMS. Your order #12345 has been shipped already and will reach you in the next 2 - 3 days.

 


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


Need a techie for this integration?
 Check our Phone a Friend App 
GET /path/file.html HTTP/1.0