import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.texml.accounts.calls.retrieveCalls('account_sid');
console.log(response.calls);{
"calls": [],
"end": 0,
"first_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1",
"next_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=1&PageSize=1&PageToken=MTY4AjgyNDkwNzIxMQ",
"page": 0,
"page_size": 1,
"start": 0,
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1"
}Returns multiple call resouces for an account. This endpoint is eventually consistent.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.texml.accounts.calls.retrieveCalls('account_sid');
console.log(response.calls);{
"calls": [],
"end": 0,
"first_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1",
"next_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=1&PageSize=1&PageToken=MTY4AjgyNDkwNzIxMQ",
"page": 0,
"page_size": 1,
"start": 0,
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The id of the account the resource belongs to.
The number of the page to be displayed, zero-indexed, should be used in conjuction with PageToken.
The number of records to be displayed on a page
Used to request the next page of results.
Filters calls by the to number.
Filters calls by the from number.
Filters calls by status.
canceled, completed, failed, busy, no-answer Filters calls by their start date. Expected format is YYYY-MM-DD.
Filters calls by their start date (after). Expected format is YYYY-MM-DD
Filters calls by their start date (before). Expected format is YYYY-MM-DD
Filters calls by their end date. Expected format is YYYY-MM-DD
Filters calls by their end date (after). Expected format is YYYY-MM-DD
Filters calls by their end date (before). Expected format is YYYY-MM-DD
Multiple call resources.
Show child attributes
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"
The number of the last element on the page, zero-indexed.
19
/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1
"accepted"
/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=1&PageSize=1&PageToken=MTY4AjgyNDkwNzIxMQ
"accepted"
Current page number, zero-indexed.
0
The number of items on the page
20
The number of the first element on the page, zero-indexed.
0
The URI of the current page.
"/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1"
Was this page helpful?