To get the different call legs associated with a call, you need to make an HTTP GET request to
https://<your_api_key>:<your_api_token><subdomain>/v3/accounts/<your_sid>/calls/<call_sid>/legs
Example (For Singapore Stamp)-
https://<your_api_key<your_api_token>@ccm-api.exotel.com/v3/accounts/<your_sid>/calls/<call_sid>/legs
Example (For Mumbai Stamp)
https://<your_api_key<your_api_token>@ccm-api.in.exotel.com/v3/accounts/<your_sid>/calls/<call_sid>/legs
<your_api_key>
and <your_api_token>
with the API key and token created by you OR use Basic Authentication.<your_sid>
with your “Account sid”<subdomain>
with the region of your account<call_sid>
with the Call Sid provided during Click to Call API request.<your_api_key>
, <your_api_token>
and <your_sid>
are available in the API settings page of your Exotel Dashboard
curl -X GET https://<your_api_key@ccm-api.exotel.com/v3/accounts//calls//legs -H 'content-type: application/json'
Parameter Name |
Type & Value |
request_id |
This indicates the unique id of the request. Useful for debugging and tracing purposes. |
method |
This indicates the HTTP method for the request such as GET/POST/PUT etc. |
http_code |
This indicates the HTTP code for the request such as 200, 400, 500 etc. |
response |
Response block contains the leg details for call sid passed in the path parameter. The block contains
|
Parameter Name |
Description |
---|---|
sid |
string; an alpha-numeric unique identifier of the call |
from |
Array of JSON blocks containing information about the 'from' leg. For outgoing calls, this array will contain all the user call leg (s) information. For incoming calls, this array will contain the customer call leg information. The JSON block contains:
|
to |
Array of JSON blocks containing information about the 'to' leg. For outgoing calls, this array will contain the customer call leg information. For incoming calls, this array will contain all the user call leg (s) information. The JSON block contains:
|
{ "request_id": "faf6d9fd87eb4dd6aef3967c40e369ed", "method": "GET", "http_code": 200, "metadata": null, "response": { "code": 200, "error_data": null, "status": "success", "leg_details": { "call_sid": "f1ca1057692d586b23b4e7ffcc3216mk", "account_sid": "exotel", "from": [ { "sid": "213f2560d153d744cd61eb81a98616ak", "name": "Aditya Sharma", "contact_uri": "0987xxxxxxx", "date_created": "2020-09-15 11:01:20+05:30", "date_updated": "2020-09-15 11:02:20+05:30", "status": "completed" }, { "sid": "813f2660d153d744cd61eb81a98616ak", "name": null, "contact_uri": "09976xxxxxx", "date_created": "2020-09-15 11:03:20+05:30", "date_updated": "2020-09-15 11:04:20+05:30", "status": "completed" } ], "to": [ { "sid": "922g2560d153d744cd61eb81a92616am", "name": "Vikas Sharma", "contact_uri": "sip:vikassffbbfc17", "date_created": "2020-09-15 11:01:20+05:30", "date_updated": "2020-09-15 11:02:20+05:30", "status": "no-answer", "group_id": 123456, "group_name": "test_group" }, { "sid": "544r1560d153d754cd61tb83a77616ak", "name": "Sanjay Mishra", "contact_uri": "08887xxxxxx", "date_created": "2020-09-15 11:03:20+05:30", "date_updated": "2020-09-15 11:04:20+05:30", "status": "completed", "group_id": null, "group_name": null } ] } } }
Http Code |
Error Code |
Description |
---|---|---|
500 |
- |
Internal Server Error |
500 |
10743 |
Legs not found |
500 |
10715 |
Error retrieving leg details |
429 |
10724 |
Too many requests (from Mavrix) |
404 |
10744 |
Call not found |
404 |
1017 |
Tenant not found |
401 |
1010 |
Authentication failed |