API FAQs
Outbound Call to connect a Customer to an App
3 min
this api will first call the customer, and once they pick up the phone, it will connect them to an app (aka flow) that you have created in the system like your landing app, or any other app that can play a greeting, have ivr etc a http post request to https //\<your api key> \<your api token>@\<subdomain>/v1/accounts/\<your sid>/calls/connect has to be made replace \<your api key> and \<your api token> with the api key and token created by you 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 in the api settings page of your exotel dashboard the following are the post parameters parameter name mandatory/optional value from mandatory the customer phone # that will be called first in the case of mobile numbers, prefix the 10 digits with a 0; ex 09052161119 in case of landline number, prefix it with std code; ex 08030752400 callerid mandatory this is your exotel number (pick one from the 'company numbers' page) calltype mandatory "trans" for transactional calls url mandatory "http //my exotel in/exoml/start/ appid " where appid is the identifier of the app (or flow) that you want to connect to once the 'from' number picks up the call timelimit optional the time limit (in seconds) that you want this call to last the maximum is 4 hours the call will be cut after this time timeout optional the time (in seconds) to ring the called parties (both first and second call leg) maximum is 1 minute (which, we hear is mandated by trai) statuscallback optional when the call completes, an http post will be made to the url mentioned with the following four parameters (this data will be passed in the message body and as multipart/form data) callsid an alpha numeric unique identifier status {completed, failed, busy, no answer} recordingurl link to the call recording (if it exists) dateupdated time when the call state was updated last customfield optional any application specific value that will be passed back as a parameter while doing a get request to the url mentioned in your passthru applet or greetings applet http response on success, the http response status code will be 200 the http body will contain an xml such as what's given below the "sid" is the unique identifier of the call and will be useful to log this for future debuggability purposes \<?xml version="1 0" encoding="utf 8"?> \<twilioresponse> \<call> \<sid>xxxxxxxxxxxxxxxxxxxx\</sid> \<parentcallsid/> \<datecreated>2012 08 17 12 31 49\</datecreated> \<dateupdated>2012 08 17 12 31 49\</dateupdated> \<accountsid>xxxxxxxxx\</accountsid> \<to>09052161119\</to> \<from>09739761117\</from> \<phonenumbersid>xxxxxxx\</phonenumbersid> \<status>in progress\</status> \<starttime>2012 08 17 12 31 49\</starttime> \<endtime>2012 08 17 12 32 57\</endtime> \<duration>\</duration> \<price>\</price> \<direction>outbound api\</direction> \<answeredby/> \<forwardedfrom/> \<callername/> \<recordingurl/> \<uri>/v1/accounts/xxxxxxxx/calls/xxxxxxxxxxxxxx\</uri> \</call> \</twilioresponse> on failure the http response status code will be non 200 the http body will contain an xml such as below with the details of why the request failed \<twilioresponse> \<restexception> \<status>400\</status> \<message>invalid call parameters no 'from' specified\</message> \</restexception> \</twilioresponse> rate limit this api is rate limited to 200 calls per minute once this limit has been crossed, your requests will be rejected with an http 429 'too many requests' code you can run this api in curl, nodejs, php, python, and ruby the requests can be taken from the developer portal sample php code an example php code for this is available on github sample ruby code sample code is available at github and ruby gem available at rubygems org
🤔
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.