This API will connect the two numbers given for the agent and customer. It will connect ‘From’ number first. Once the person at ‘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
has to be made.
Replace ~exotel_sid~ and ~exotel_token~ with the values from the Exotel Settings tab of your Exotel portal.
The following are the POST parameters:
The Agent phone # that will be called first
Your customer's phone number.
This is your Exotel Number (pick one from the 'Company Numbers' page)
"trans" - for Transactional Calls
||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)
The time (in seconds) to ring the called parties (both first and second call leg)
When the call completes, an HTTP POST will be made to the URL mentioned with the following four parameters:
|MaxRetries||Optional||Number of times the call should be retried if we get failed or no-answer status from 1st leg.
(Default value: 3)
- 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"?>|
- 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.
<Message>No matching results</Message>
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:
Sample Ruby Code: