API FAQs
Outbound Call to connect an Agent to a Customer
3 min
this api will connect the two numbers given for an agent and the customer it will connect the ‘from’ number first once the person at the ‘from’ end picks up the phone, it will connect to the number provided in the ‘to’ you can choose which number to be connected first by giving that number in the ‘from’ field an 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 on the api settings page of your exotel dashboard the following are the post parameters parameter name mandatory/optional value from mandatory the agent's phone # that will be called first if mobile number, prefix the 10 digits with a 0; ex ✆✆ 09052161119 if landline number, prefix it with std code; ex 08030752400 to mandatory your customer's phone number if mobile number, prefix the 10 digits with a 0; ex ✆✆ 09052161119 if 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 timelimit optional the time limit (in seconds) that you want this call to last the call will be cut after this time (max 14400 i e 4 hours) timeout optional the time (in seconds) to ring the called parties (both first and second call leg) statuscallback optional when the call completes, an http post will be made to the url mentioned with the following four parameters callsid an alpha numeric unique identifier status one of completed, failed, busy, no answer recordingurl link to the call recording (if it exists) dateupdated time when the call state was updated last maxretries optional the number of times the call should be retried if we get failed or no answer status from 1st leg (default value 3) "trans" for transactional calls "promo" for promotional calls no longer supported by exotel http response on success, the http response status code will be 200 the http body will contain an xml similar to the one below the "sid" is the unique identifier of the call and it will be useful to log this for future debugging 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 the one below) with details of why the request failed \<twilioresponse> \<restexception> \<status>404\</status> \<message>no matching results\</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 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.