Call Details (v2)
Retrieve detailed information about a specific call made via the Voice v2 (CCM) API.
Path Parameters
| Parameter | Required | Description |
|---|---|---|
call_sid | Yes | The unique call identifier from the Connect Agent to Customer response |
Code Examples
- cURL
- Python
- Node.js
- PHP
- Go
curl -u '<api_key>:<api_token>' 'https://ccm-api.exotel.com/v2/accounts/<account_sid>/calls/<call_sid>'
import requests
response = requests.get(
f"https://ccm-api.exotel.com/v2/accounts/{account_sid}/calls/{call_sid}",
auth=(api_key, api_token)
)
print(response.json())
const apiKey = '<api_key>';
const apiToken = '<api_token>';
const accountSid = '<account_sid>';
const callSid = '<call_sid>';
const url = `https://ccm-api.exotel.com/v2/accounts/${accountSid}/calls/${callSid}`;
const response = await fetch(url, {
headers: {
'Authorization': 'Basic ' + Buffer.from(`${apiKey}:${apiToken}`).toString('base64'),
},
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_USERPWD => "<api_key>:<api_token>",
CURLOPT_URL => "https://ccm-api.exotel.com/v2/accounts/<account_sid>/calls/<call_sid>",
CURLOPT_RETURNTRANSFER => true,
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://ccm-api.exotel.com/v2/accounts/<account_sid>/calls/<call_sid>"
req, _ := http.NewRequest("GET", url, nil)
req.SetBasicAuth("<api_key>", "<api_token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
Response
{
"request_id": "req_abc123",
"method": "GET",
"http_code": 200,
"response": {
"call_details": {
"sid": "unique_call_identifier",
"direction": "outbound-api",
"virtual_number": "+911234567890",
"state": "terminal",
"status": "completed",
"assigned_agent_details": {
"user_id": "agent-uuid",
"contact_uri": "sip:agent@exotel.com"
},
"customer_details": {
"number": "+919876543210"
},
"created_time": "2024-06-15T10:30:00.000Z",
"updated_time": "2024-06-15T10:35:05.000Z",
"start_time": "2024-06-15T10:30:01.000Z",
"end_time": "2024-06-15T10:35:00.000Z",
"total_duration": 300,
"total_talk_time": 280,
"recording": {
"available": true,
"url": "https://s3-ap-southeast-1.amazonaws.com/.../recording.mp3"
},
"custom_field": "ticket_12345",
"legs": "/v2/accounts/<account_sid>/calls/<call_sid>/legs"
}
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
sid | String | Unique call identifier |
direction | String | inbound, outbound-dial, outbound-api |
virtual_number | String | ExoPhone used |
state | String | active or terminal |
status | String | Call status (see below) |
assigned_agent_details | Object | Agent user_id and contact_uri |
customer_details | Object | Customer phone number |
created_time | DateTime | API request timestamp |
updated_time | DateTime | Last status update |
start_time | DateTime | Call start time |
end_time | DateTime | Call end time |
total_duration | Integer | Total duration in seconds |
total_talk_time | Integer | Customer conversation time in seconds |
recording | Object | Recording availability and URL |
custom_field | String | Custom metadata |
legs | String | URL to fetch call leg details |
Call States & Statuses
States
| State | Description |
|---|---|
active | Call is ongoing or post-call processing pending |
terminal | Call completed and all data processed |
Statuses
| Status | Description |
|---|---|
completed | Call connected and ended normally |
agent_unanswered | Agent did not answer |
customer_unanswered | Customer did not answer |
agent_canceled | Agent canceled the call |
customer_no_dial | Could not dial customer |
agent_no_dial | Could not dial agent |