Video:



This document outlines an API to query all the participants in the completed calls. The use case where this API will be useful 

  1. Calls where more than 2 participants were there in a call. For Ex:- Dialer, Cold transfer, Connect after connect 

  2. Listen, Whisper or  Barge use case. More details of LWB API is here   

 

NOTE:- In Order to use this API, one needs to provide the callSID of the completed call. This is a dependency for the  API

 

NOTE:- To enable this API in your account, please reach out to hello@exotel.com 

 

To get the details of a call , you will need to make a HTTP GET request to 

https://<your_api_key>:<your_api_token>@<subdomain>/v1/Accounts/~exotel_sid~/Calls/<CallSid>/Legs

  • <CallSid> is the Sid of the call.

  • 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


In the case of an outbound call originating via the Call APIs (here or here), the "Sid" parameter is returned in the XML response to your request.

In the case of inbound calls, you can get the CallSid by using the Passthru applet


HTTP Response:

On success, this API will return an HTTP status code of 200 and the response body will contain an XML/JSON (like below) that contains the details of the call.

On failure, the HTTP status code will be a non-200 code which indicates the reason (as discussed here ).



Response Body on Success:


{

  • "MetaData":{

    • "Total":3,

    • "Count":3

  • },

  • "legs":[

    • {

      • "Sid":"XXXXXXXXXXXXXX",

      • "CallSid":"XXXXXXXXXXXXXX",

      • "AccountSid":"exotelt",

      • "PhoneNumber":"XXXXXXXXXXXXXX",

      • "Status":"completed",

      • "Origin":"outbound",

      • "LastAction":"",

      • "DateCreated":"2021-06-24 11:12:39",

      • "DateUpdated":"2021-06-24 11:13:08",

      • "OnCallDuration":25,

      • "Uri":"/v1/Accounts/exotelt/Calls/XXXXXXXXXXXXXX/Legs/XXXXXXXXXXXXXX"

    • },

    • {

      • "Sid":"XXXXXXXXXXXXXX",

      • "CallSid":"XXXXXXXXXXXXXX",

      • "AccountSid":"exotelt",

      • "PhoneNumber":"XXXXXXXXXXXXXX",

      • "Status":"completed",

      • "Origin":"outbound-dial",

      • "LastAction":"",

      • "DateCreated":"2021-06-24 11:12:48",

      • "DateUpdated":"2021-06-24 11:12:57",

      • "OnCallDuration":5,

      • "Uri":"/v1/Accounts/exotelt/Calls/XXXXXXXXXXXXXX/Legs/XXXXXXXXXXXXXX"

    • },

    • {

      • "Sid":"XXXXXXXXXXXXXX",

      • "CallSid":"XXXXXXXXXXXXXX",

      • "AccountSid":"exotelt",

      • "PhoneNumber":"XXXXXXXXXXXXXX",

      • "Status":"completed",

      • "Origin":"outbound-dial",

      • "LastAction":"",

      • "DateCreated":"2021-06-24 11:12:58",

      • "DateUpdated":"2021-06-24 11:13:07",

      • "StartTime":"2021-06-24 11:12:58",

      • "EndTime":"2021-06-24 11:13:08",

      • "ExoPhone":"XXXXXXXXXX",

      • "BackupEcoPhone":"XXXXXXXXXX",


      • "OnCallDuration":4,

      • "Uri":"/v1/Accounts/exotelt/Calls/XXXXXXXXXXXXXX/Legs/XXXXXXXXXXXXXX"

    • }

  • ]

}



The "Status" parameter can take one of the following values: 

  • queued
  • in-progress
  • completed
  • failed
  • busy
  • no-answer


The "Origin" parameter can take one of the following values: 

  • Inbound:- Customers dialing into Exotel Virtual number

  • Outbound:- 1st leg of connect API 

  • Outbound-dial:-  Subsequent dial out from Exotel platform post 1st leg is established ( either via inbound/outbound)

  • Monitor:- Supervisor leg performing the Listen / Whisper / Barge actions 



Response Body on failure:

{

  • "RestException":{

    • "Code":400,

    • "Message":"Bad Request",

    • "Description":"Please check the callSID passed"

  • }

}


Rate Limit:

This API is rate limited to 200 queries per minute. Once this limit has been crossed, your requests will be rejected with an HTTP 429 'Too Many Requests' code.