import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.calls.retrieveStatus('call_control_id');
console.log(response.data);{
"data": {
"call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
"call_leg_id": "2dc6fc34-f9e0-11ea-b68e-02420a0f7768",
"call_session_id": "2dc1b3c8-f9e0-11ea-bc5a-02420a0f7768",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"is_alive": false,
"call_duration": 50,
"start_time": "2019-01-23T18:10:02.574Z",
"end_time": "2019-01-23T18:11:52.574Z",
"record_type": "call"
}
}Returns the status of a call (data is available 10 minutes after call ended).
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.calls.retrieveStatus('call_control_id');
console.log(response.data);{
"data": {
"call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
"call_leg_id": "2dc6fc34-f9e0-11ea-b68e-02420a0f7768",
"call_session_id": "2dc1b3c8-f9e0-11ea-bc5a-02420a0f7768",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"is_alive": false,
"call_duration": 50,
"start_time": "2019-01-23T18:10:02.574Z",
"end_time": "2019-01-23T18:11:52.574Z",
"record_type": "call"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Unique identifier and token for controlling the call
Successful response with details about a call status.
Show child attributes
call "call"
ID that is unique to the call session and can be used to correlate webhook events. Call session is a group of related call legs that logically belong to the same phone call, e.g. an inbound and outbound leg of a transferred call
"428c31b6-7af4-4bcb-b68e-5013ef9657c1"
ID that is unique to the call and can be used to correlate webhook events
"428c31b6-7af4-4bcb-b7f5-5013ef9657c1"
Unique identifier and token for controlling the call.
"v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
Indicates whether the call is alive or not. For Dial command it will always be false (dialing is asynchronous).
true
State received from a command.
"aGF2ZSBhIG5pY2UgZGF5ID1d"
Indicates the duration of the call in seconds
50
ISO 8601 formatted date indicating when the call started
"2019-01-23T18:10:02.574Z"
ISO 8601 formatted date indicating when the call ended. Only present when the call is not alive
"2019-01-23T18:11:52.574Z"
{
"call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
"call_leg_id": "2dc6fc34-f9e0-11ea-b68e-02420a0f7768",
"call_session_id": "2dc1b3c8-f9e0-11ea-bc5a-02420a0f7768",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"is_alive": false,
"call_duration": 50,
"start_time": "2019-01-23T18:10:02.574Z",
"end_time": "2019-01-23T18:11:52.574Z",
"record_type": "call"
}Was this page helpful?