Get Call
curl --request GET \
--url https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId} \
--header 'apikey: <api-key>'import requests
url = "https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"sessionId": "v1.us.31780434a95d45.16923681138d75114d60d1345a22e4cc612263fb26c0b5cf92",
"totalAudioMinutes": 0.31666666666666665,
"totalVideoMinutes": 0,
"totalDuration": "00:00:19",
"metaData": [],
"hasRecording": false,
"initiatedAt": 1692368113,
"initiator": "superhero8",
"mode": "call",
"receiver": "superhero2",
"receiverType": "user",
"status": "ended",
"tags": [],
"totalDurationInMinutes": 0.31666666666666665,
"totalParticipants": 2,
"type": "audio",
"mid": "855e1519-1244-4213-8e40-53044c1e9e43",
"startedAt": 1692368127,
"endedAt": 1692368146,
"participants": [
{
"uid": "superhero2",
"totalAudioMinutes": 0.23333333333333334,
"totalVideoMinutes": 0,
"totalDuration": 0.23333333333333334,
"deviceId": "c9ed493e-8495-428d-b6ee-b32019cc57ce@rtc.cometchat-staging.com/CKT3xgR4",
"isJoined": true,
"joinedAt": 1692368132,
"mid": "855e1519-1244-4213-8e40-53044c1e9e43",
"state": "ended",
"leftAt": 1692368146
},
{
"uid": "superhero8",
"totalAudioMinutes": 0.26666666666666666,
"totalVideoMinutes": 0,
"totalDuration": 0.26666666666666666,
"deviceId": "70ecae89-b71c-4bb3-8220-b7c99ec1658f@rtc.cometchat-staging.com/hsYWb5ul",
"isJoined": true,
"joinedAt": 1692368128,
"mid": "855e1519-1244-4213-8e40-53044c1e9e43",
"state": "ended",
"leftAt": 1692368144
}
]
}
}Calls
Get Call
Get CometChat call details by sessionId with REST API, including participants, metrics, duration, and recording information.
GET
/
calls
/
{sessionId}
Get Call
curl --request GET \
--url https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId} \
--header 'apikey: <api-key>'import requests
url = "https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.call-{region}.cometchat.io/v3/calls/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"sessionId": "v1.us.31780434a95d45.16923681138d75114d60d1345a22e4cc612263fb26c0b5cf92",
"totalAudioMinutes": 0.31666666666666665,
"totalVideoMinutes": 0,
"totalDuration": "00:00:19",
"metaData": [],
"hasRecording": false,
"initiatedAt": 1692368113,
"initiator": "superhero8",
"mode": "call",
"receiver": "superhero2",
"receiverType": "user",
"status": "ended",
"tags": [],
"totalDurationInMinutes": 0.31666666666666665,
"totalParticipants": 2,
"type": "audio",
"mid": "855e1519-1244-4213-8e40-53044c1e9e43",
"startedAt": 1692368127,
"endedAt": 1692368146,
"participants": [
{
"uid": "superhero2",
"totalAudioMinutes": 0.23333333333333334,
"totalVideoMinutes": 0,
"totalDuration": 0.23333333333333334,
"deviceId": "c9ed493e-8495-428d-b6ee-b32019cc57ce@rtc.cometchat-staging.com/CKT3xgR4",
"isJoined": true,
"joinedAt": 1692368132,
"mid": "855e1519-1244-4213-8e40-53044c1e9e43",
"state": "ended",
"leftAt": 1692368146
},
{
"uid": "superhero8",
"totalAudioMinutes": 0.26666666666666666,
"totalVideoMinutes": 0,
"totalDuration": 0.26666666666666666,
"deviceId": "70ecae89-b71c-4bb3-8220-b7c99ec1658f@rtc.cometchat-staging.com/hsYWb5ul",
"isJoined": true,
"joinedAt": 1692368128,
"mid": "855e1519-1244-4213-8e40-53044c1e9e43",
"state": "ended",
"leftAt": 1692368144
}
]
}
}Retrieve detailed information about a specific call using its session ID. This endpoint returns complete call data including all participants, their individual metrics, and recording information.
When to Use
| Scenario | Description |
|---|---|
| Call details page | Display comprehensive information about a completed call |
| Recording access | Get the recording URL for playback or download |
| Participant analytics | View individual participant metrics (join time, duration, etc.) |
| Debugging | Investigate issues with a specific call session |
Example Request
curl -X GET "https://{appId}.call-{region}.cometchat.io/v3/calls/v1.us.31780434a95d45.16923681138d75114d60d1345a22e4cc612263fb26c0b5cf92" \
-H "apikey: YOUR_REST_API_KEY"
Response Details
The response includes:- Call metadata: Type, mode, status, duration, timestamps
- Participants array: Each participant’s UID, device ID, join/leave times, and individual audio/video minutes
- Recordings array: Recording IDs, URLs, duration, and timestamps (if
hasRecordingis true)
The
sessionId is returned when a call is initiated via the SDK or can be found in the List Calls response.Participant States
Each participant in the response has astate field:
| State | Description |
|---|---|
ongoing | Participant is currently in the call |
ended | Participant left the call normally |
unanswered | Participant didn’t answer the call |
rejected | Participant rejected the call |
Authorizations
API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
Headers
UID of the user on whose behalf the action is performed.
Path Parameters
Call to Retreive
Response
200 - application/json
Rereives Call Details
Show child attributes
Show child attributes
Was this page helpful?
⌘I