import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const voices = await client.legacy.reporting.usageReports.voice.list();
console.log(voices.data);{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_time": "2018-02-02T22:25:27.521Z",
"end_time": "2018-02-02T22:25:27.521Z",
"connections": [
"1234567890",
"9876543210"
],
"aggregation_type": 123,
"status": 123,
"report_url": "http://portal.telnyx.com/downloads/report_name_8hvb45Gu.csv",
"result": {},
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"record_type": "cdr_usage_report",
"product_breakdown": 123
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}Fetch all previous requests for cdr usage reports.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const voices = await client.legacy.reporting.usageReports.voice.list();
console.log(voices.data);{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_time": "2018-02-02T22:25:27.521Z",
"end_time": "2018-02-02T22:25:27.521Z",
"connections": [
"1234567890",
"9876543210"
],
"aggregation_type": 123,
"status": 123,
"report_url": "http://portal.telnyx.com/downloads/report_name_8hvb45Gu.csv",
"result": {},
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"record_type": "cdr_usage_report",
"product_breakdown": 123
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Page number
x >= 1Size of the page
1 <= x <= 250Successful
Show child attributes
Identifies the resource
"2018-02-02T22:25:27.521Z"
"2018-02-02T22:25:27.521Z"
["1234567890", "9876543210"]Aggregation type: All = 0, By Connections = 1, By Tags = 2, By Billing Group = 3
Status of the report: Pending = 1, Complete = 2, Failed = 3, Expired = 4
"http://portal.telnyx.com/downloads/report_name_8hvb45Gu.csv"
"2018-02-02T22:25:27.521Z"
"2018-02-02T22:25:27.521Z"
"cdr_usage_report"
Product breakdown type: No breakdown = 0, DID vs Toll-free = 1, Country = 2, DID vs Toll-free per Country = 3
Was this page helpful?