import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const call = await client.texml.accounts.calls.retrieve('call_sid', { account_sid: 'account_sid' });
console.log(call.account_sid);{
"account_sid": "61bf923e-5e4d-4595-a110-56190ea18a1b",
"answered_by": null,
"caller_name": "+13122010094",
"date_created": "Thu, 15 Jun 2023 09:56:45 +0000",
"date_updated": "Thu, 15 Jun 2023 09:56:56 +0000",
"direction": "inbound",
"duration": "11",
"end_time": "Thu, 15 Jun 2023 09:56:56 +0000",
"from": "+13123456789",
"from_formatted": "(312) 345-6789",
"price": null,
"price_unit": null,
"sid": "v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA",
"start_time": "Thu, 15 Jun 2023 09:56:45 +0000",
"status": "completed",
"to": "+13987654321",
"to_formatted": "(398) 765-4321",
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA.json"
}Returns an individual call identified by its CallSid. This endpoint is eventually consistent.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const call = await client.texml.accounts.calls.retrieve('call_sid', { account_sid: 'account_sid' });
console.log(call.account_sid);{
"account_sid": "61bf923e-5e4d-4595-a110-56190ea18a1b",
"answered_by": null,
"caller_name": "+13122010094",
"date_created": "Thu, 15 Jun 2023 09:56:45 +0000",
"date_updated": "Thu, 15 Jun 2023 09:56:56 +0000",
"direction": "inbound",
"duration": "11",
"end_time": "Thu, 15 Jun 2023 09:56:56 +0000",
"from": "+13123456789",
"from_formatted": "(312) 345-6789",
"price": null,
"price_unit": null,
"sid": "v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA",
"start_time": "Thu, 15 Jun 2023 09:56:45 +0000",
"status": "completed",
"to": "+13987654321",
"to_formatted": "(398) 765-4321",
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA.json"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The CallSid that identifies the call to update.
The id of the account the resource belongs to.
Call resource.
The id of the account the resource belongs to.
"61bf923e-5e4d-4595-a110-56190ea18a1b"
The value of the answering machine detection result, if this feature was enabled for the call.
human, machine, not_sure "human"
Caller ID, if present.
"CALLER"
The timestamp of when the resource was created.
"Thu, 15 Jun 2023 09:56:45 +0000"
The timestamp of when the resource was last updated.
"Thu, 15 Jun 2023 09:56:45 +0000"
The direction of this call.
inbound, outbound "inbound"
The duration of this call, given in seconds.
"12"
The end time of this call.
"Thu, 15 Jun 2023 09:56:45 +0000"
The phone number or SIP address that made this call.
"+13123456789"
The from number formatted for display.
"(312) 345-6789"
The price of this call, the currency is specified in the price_unit field. Only populated when the call cost feature is enabled for the account.
"0.10"
The unit in which the price is given.
"USD"
The identifier of this call.
"v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA"
The start time of this call.
"Thu, 15 Jun 2023 09:56:45 +0000"
The status of this call.
ringing, in-progress, canceled, completed, failed, busy, no-answer "completed'"
The phone number or SIP address that received this call.
"+13987654321"
The to number formatted for display.
"(398) 765-4321"
The relative URI for this call.
"/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA.json"
Was this page helpful?