telnyx-account-reports-javascript
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
Telnyx Account Reports - JavaScript
Telnyx账户报告 - JavaScript
Installation
安装
bash
npm install telnyxbash
npm install telnyxSetup
设置
javascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});All examples below assume is already initialized as shown above.
clientjavascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});以下所有示例均假设已按上述方式初始化。
clientError Handling
错误处理
All API calls can fail with network errors, rate limits (429), validation errors (422),
or authentication errors (401). Always handle errors in production code:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: rate limited — wait and retry with exponential backoff
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API error ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('Validation error — check required fields and formats');
}
}
}Common error codes: invalid API key, insufficient permissions,
resource not found, validation error (check field formats),
rate limited (retry with exponential backoff).
401403404422429所有API调用都可能因网络错误、速率限制(429)、验证错误(422)或认证错误(401)而失败。在生产代码中务必处理错误:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: rate limited — wait and retry with exponential backoff
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API error ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('Validation error — check required fields and formats');
}
}
}常见错误码:无效API密钥,权限不足,资源未找到,验证错误(检查字段格式),速率限制(使用指数退避重试)。
401403404422429Important Notes
重要注意事项
- Pagination: List methods return an auto-paginating iterator. Use to iterate through all pages automatically.
for await (const item of result) { ... }
- 分页: 列表方法返回一个自动分页的迭代器。使用自动遍历所有页面。
for await (const item of result) { ... }
List call events
列出通话事件
Filters call events by given filter parameters. Events are ordered by . If filter for or is not present, it only filters events from the last 24 hours.
occurred_atleg_idapplication_session_idGET /call_eventsjavascript
// Automatically fetches more pages as needed.
for await (const callEventListResponse of client.callEvents.list()) {
console.log(callEventListResponse.call_leg_id);
}Returns: (string), (string), (string), (object), (string), (enum: call_event), (enum: command, webhook)
call_leg_idcall_session_idevent_timestampmetadatanamerecord_typetype按给定筛选参数筛选通话事件。事件按排序。如果未提供或筛选条件,则仅筛选过去24小时内的事件。
occurred_atleg_idapplication_session_idGET /call_eventsjavascript
// Automatically fetches more pages as needed.
for await (const callEventListResponse of client.callEvents.list()) {
console.log(callEventListResponse.call_leg_id);
}返回:(字符串)、(字符串)、(字符串)、(对象)、(字符串)、(枚举:call_event)、(枚举:command, webhook)
call_leg_idcall_session_idevent_timestampmetadatanamerecord_typetypeCreate a ledger billing group report
创建账本计费组报告
POST /ledger_billing_group_reportsOptional: (integer), (integer)
monthyearjavascript
const ledgerBillingGroupReport = await client.ledgerBillingGroupReports.create({
month: 10,
year: 2019,
});
console.log(ledgerBillingGroupReport.data);Returns: (date-time), (uuid), (uuid), (enum: ledger_billing_group_report), (uri), (enum: pending, complete, failed, deleted), (date-time)
created_atidorganization_idrecord_typereport_urlstatusupdated_atPOST /ledger_billing_group_reports可选参数:(整数)、(整数)
monthyearjavascript
const ledgerBillingGroupReport = await client.ledgerBillingGroupReports.create({
month: 10,
year: 2019,
});
console.log(ledgerBillingGroupReport.data);返回:(日期时间)、(uuid)、(uuid)、(枚举:ledger_billing_group_report)、(uri)、(枚举:pending, complete, failed, deleted)、(日期时间)
created_atidorganization_idrecord_typereport_urlstatusupdated_atGet a ledger billing group report
获取账本计费组报告
GET /ledger_billing_group_reports/{id}javascript
const ledgerBillingGroupReport = await client.ledgerBillingGroupReports.retrieve(
'f5586561-8ff0-4291-a0ac-84fe544797bd',
);
console.log(ledgerBillingGroupReport.data);Returns: (date-time), (uuid), (uuid), (enum: ledger_billing_group_report), (uri), (enum: pending, complete, failed, deleted), (date-time)
created_atidorganization_idrecord_typereport_urlstatusupdated_atGET /ledger_billing_group_reports/{id}javascript
const ledgerBillingGroupReport = await client.ledgerBillingGroupReports.retrieve(
'f5586561-8ff0-4291-a0ac-84fe544797bd',
);
console.log(ledgerBillingGroupReport.data);返回:(日期时间)、(uuid)、(uuid)、(枚举:ledger_billing_group_report)、(uri)、(枚举:pending, complete, failed, deleted)、(日期时间)
created_atidorganization_idrecord_typereport_urlstatusupdated_atGet all MDR detailed report requests
获取所有MDR详细报告请求
Retrieves all MDR detailed report requests for the authenticated user
GET /legacy/reporting/batch_detail_records/messagingjavascript
const messagings = await client.legacy.reporting.batchDetailRecords.messaging.list();
console.log(messagings.data);Returns: (array[integer]), (date-time), (array[string]), (date-time), (array[object]), (uuid), (array[string]), (string), (array[string]), (string), (string), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_at检索已认证用户的所有MDR详细报告请求
GET /legacy/reporting/batch_detail_records/messagingjavascript
const messagings = await client.legacy.reporting.batchDetailRecords.messaging.list();
console.log(messagings.data);返回:(整数数组)、(日期时间)、(字符串数组)、(日期时间)、(对象数组)、(uuid)、(字符串数组)、(字符串)、(字符串数组)、(字符串)、(字符串)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_atCreate a new MDR detailed report request
创建新的MDR详细报告请求
Creates a new MDR detailed report request with the specified filters
POST /legacy/reporting/batch_detail_records/messagingstart_timeend_timeOptional: (array[integer]), (array[integer]), (array[object]), (boolean), (array[string]), (array[string]), (array[integer]), (string), (boolean), (string)
connectionsdirectionsfiltersinclude_message_bodymanaged_accountsprofilesrecord_typesreport_nameselect_all_managed_accountstimezonejavascript
const messaging = await client.legacy.reporting.batchDetailRecords.messaging.create({
end_time: '2024-02-12T23:59:59Z',
start_time: '2024-02-01T00:00:00Z',
});
console.log(messaging.data);Returns: (array[integer]), (date-time), (array[string]), (date-time), (array[object]), (uuid), (array[string]), (string), (array[string]), (string), (string), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_at使用指定筛选条件创建新的MDR详细报告请求
POST /legacy/reporting/batch_detail_records/messagingstart_timeend_time可选参数:(整数数组)、(整数数组)、(对象数组)、(布尔值)、(字符串数组)、(字符串数组)、(整数数组)、(字符串)、(布尔值)、(字符串)
connectionsdirectionsfiltersinclude_message_bodymanaged_accountsprofilesrecord_typesreport_nameselect_all_managed_accountstimezonejavascript
const messaging = await client.legacy.reporting.batchDetailRecords.messaging.create({
end_time: '2024-02-12T23:59:59Z',
start_time: '2024-02-01T00:00:00Z',
});
console.log(messaging.data);返回:(整数数组)、(日期时间)、(字符串数组)、(日期时间)、(对象数组)、(uuid)、(字符串数组)、(字符串)、(字符串数组)、(字符串)、(字符串)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_atGet a specific MDR detailed report request
获取特定的MDR详细报告请求
Retrieves a specific MDR detailed report request by ID
GET /legacy/reporting/batch_detail_records/messaging/{id}javascript
const messaging = await client.legacy.reporting.batchDetailRecords.messaging.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(messaging.data);Returns: (array[integer]), (date-time), (array[string]), (date-time), (array[object]), (uuid), (array[string]), (string), (array[string]), (string), (string), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_at通过ID检索特定的MDR详细报告请求
GET /legacy/reporting/batch_detail_records/messaging/{id}javascript
const messaging = await client.legacy.reporting.batchDetailRecords.messaging.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(messaging.data);返回:(整数数组)、(日期时间)、(字符串数组)、(日期时间)、(对象数组)、(uuid)、(字符串数组)、(字符串)、(字符串数组)、(字符串)、(字符串)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_atDelete a MDR detailed report request
删除MDR详细报告请求
Deletes a specific MDR detailed report request by ID
DELETE /legacy/reporting/batch_detail_records/messaging/{id}javascript
const messaging = await client.legacy.reporting.batchDetailRecords.messaging.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(messaging.data);Returns: (array[integer]), (date-time), (array[string]), (date-time), (array[object]), (uuid), (array[string]), (string), (array[string]), (string), (string), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_at通过ID删除特定的MDR详细报告请求
DELETE /legacy/reporting/batch_detail_records/messaging/{id}javascript
const messaging = await client.legacy.reporting.batchDetailRecords.messaging.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(messaging.data);返回:(整数数组)、(日期时间)、(字符串数组)、(日期时间)、(对象数组)、(uuid)、(字符串数组)、(字符串)、(字符串数组)、(字符串)、(字符串)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
connectionscreated_atdirectionsend_datefiltersidprofilesrecord_typerecord_typesreport_namereport_urlstart_datestatusupdated_atGet all CDR report requests
获取所有CDR报告请求
Retrieves all CDR report requests for the authenticated user
GET /legacy/reporting/batch_detail_records/voicejavascript
const voices = await client.legacy.reporting.batchDetailRecords.voice.list();
console.log(voices.data);Returns: (array[integer]), (array[integer]), (string), (string), (array[object]), (string), (array[string]), (string), (array[integer]), (string), (string), (int32), (string), (string), (int32), (string), (string)
call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_at检索已认证用户的所有CDR报告请求
GET /legacy/reporting/batch_detail_records/voicejavascript
const voices = await client.legacy.reporting.batchDetailRecords.voice.list();
console.log(voices.data);返回:(整数数组)、(整数数组)、(字符串)、(字符串)、(对象数组)、(字符串)、(字符串数组)、(字符串)、(整数数组)、(字符串)、(字符串)、(int32)、(字符串)、(字符串)、(int32)、(字符串)、(字符串)
call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_atCreate a new CDR report request
创建新的CDR报告请求
Creates a new CDR report request with the specified filters
POST /legacy/reporting/batch_detail_records/voicestart_timeend_timeOptional: (array[integer]), (array[integer]), (array[string]), (array[object]), (boolean), (array[string]), (array[integer]), (string), (boolean), (string), (string)
call_typesconnectionsfieldsfiltersinclude_all_metadatamanaged_accountsrecord_typesreport_nameselect_all_managed_accountssourcetimezonejavascript
const voice = await client.legacy.reporting.batchDetailRecords.voice.create({
end_time: '2024-02-12T23:59:59Z',
start_time: '2024-02-01T00:00:00Z',
});
console.log(voice.data);Returns: (array[integer]), (array[integer]), (string), (string), (array[object]), (string), (array[string]), (string), (array[integer]), (string), (string), (int32), (string), (string), (int32), (string), (string)
call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_at使用指定筛选条件创建新的CDR报告请求
POST /legacy/reporting/batch_detail_records/voicestart_timeend_time可选参数:(整数数组)、(整数数组)、(字符串数组)、(对象数组)、(布尔值)、(字符串数组)、(整数数组)、(字符串)、(布尔值)、(字符串)、(字符串)
call_typesconnectionsfieldsfiltersinclude_all_metadatamanaged_accountsrecord_typesreport_nameselect_all_managed_accountssourcetimezonejavascript
const voice = await client.legacy.reporting.batchDetailRecords.voice.create({
end_time: '2024-02-12T23:59:59Z',
start_time: '2024-02-01T00:00:00Z',
});
console.log(voice.data);返回:(整数数组)、(整数数组)、(字符串)、(字符串)、(对象数组)、(字符串)、(字符串数组)、(字符串)、(整数数组)、(字符串)、(字符串)、(int32)、(字符串)、(字符串)、(int32)、(字符串)、(字符串)
call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_atGet available CDR report fields
获取可用的CDR报告字段
Retrieves all available fields that can be used in CDR reports
GET /legacy/reporting/batch_detail_records/voice/fieldsjavascript
const response = await client.legacy.reporting.batchDetailRecords.voice.retrieveFields();
console.log(response.Billing);Returns: (array[string]), (array[string]), (array[string]), (array[string])
BillingInteraction DataNumber InformationTelephony Data检索可用于CDR报告的所有可用字段
GET /legacy/reporting/batch_detail_records/voice/fieldsjavascript
const response = await client.legacy.reporting.batchDetailRecords.voice.retrieveFields();
console.log(response.Billing);返回:(字符串数组)、(字符串数组)、(字符串数组)、(字符串数组)
BillingInteraction DataNumber InformationTelephony DataGet a specific CDR report request
获取特定的CDR报告请求
Retrieves a specific CDR report request by ID
GET /legacy/reporting/batch_detail_records/voice/{id}javascript
const voice = await client.legacy.reporting.batchDetailRecords.voice.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(voice.data);Returns: (array[integer]), (array[integer]), (string), (string), (array[object]), (string), (array[string]), (string), (array[integer]), (string), (string), (int32), (string), (string), (int32), (string), (string)
call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_at通过ID检索特定的CDR报告请求
GET /legacy/reporting/batch_detail_records/voice/{id}javascript
const voice = await client.legacy.reporting.batchDetailRecords.voice.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(voice.data);返回:(整数数组)、(整数数组)、(字符串)、(字符串)、(对象数组)、(字符串)、(字符串数组)、(字符串)、(整数数组)、(字符串)、(字符串)、(int32)、(字符串)、(字符串)、(int32)、(字符串)、(字符串)
call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_atDelete a CDR report request
删除CDR报告请求
Deletes a specific CDR report request by ID
DELETE /legacy/reporting/batch_detail_records/voice/{id}javascript
const voice = await client.legacy.reporting.batchDetailRecords.voice.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(voice.data);Returns: (array[integer]), (array[integer]), (string), (string), (array[object]), (string), (array[string]), (string), (array[integer]), (string), (string), (int32), (string), (string), (int32), (string), (string)
call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_at通过ID删除特定的CDR报告请求
DELETE /legacy/reporting/batch_detail_records/voice/{id}javascript
const voice = await client.legacy.reporting.batchDetailRecords.voice.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(voice.data);返回:(整数数组)、(整数数组)、(字符串)、(字符串)、(对象数组)、(字符串)、(字符串数组)、(字符串)、(整数数组)、(字符串)、(字符串)、(int32)、(字符串)、(字符串)、(int32)、(字符串)、(字符串)
call_typesconnectionscreated_atend_timefiltersidmanaged_accountsrecord_typerecord_typesreport_namereport_urlretrysourcestart_timestatustimezoneupdated_atList MDR usage reports
列出MDR使用报告
Fetch all previous requests for MDR usage reports.
GET /legacy/reporting/usage_reports/messagingjavascript
// Automatically fetches more pages as needed.
for await (const mdrUsageReportResponseLegacy of client.legacy.reporting.usageReports.messaging.list()) {
console.log(mdrUsageReportResponseLegacy.id);
}Returns: (int32), (array[string]), (date-time), (date-time), (uuid), (array[string]), (string), (string), (object), (date-time), (int32), (date-time)
aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_at获取所有MDR使用报告的历史请求。
GET /legacy/reporting/usage_reports/messagingjavascript
// Automatically fetches more pages as needed.
for await (const mdrUsageReportResponseLegacy of client.legacy.reporting.usageReports.messaging.list()) {
console.log(mdrUsageReportResponseLegacy.id);
}返回:(int32)、(字符串数组)、(日期时间)、(日期时间)、(uuid)、(字符串数组)、(字符串)、(字符串)、(对象)、(日期时间)、(int32)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_atCreate a new legacy usage V2 MDR report request
创建新的旧版V2 MDR使用报告请求
Creates a new legacy usage V2 MDR report request with the specified filters
POST /legacy/reporting/usage_reports/messagingjavascript
const messaging = await client.legacy.reporting.usageReports.messaging.create({
aggregation_type: 0,
});
console.log(messaging.data);Returns: (int32), (array[string]), (date-time), (date-time), (uuid), (array[string]), (string), (string), (object), (date-time), (int32), (date-time)
aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_at使用指定筛选条件创建新的旧版V2 MDR使用报告请求
POST /legacy/reporting/usage_reports/messagingjavascript
const messaging = await client.legacy.reporting.usageReports.messaging.create({
aggregation_type: 0,
});
console.log(messaging.data);返回:(int32)、(字符串数组)、(日期时间)、(日期时间)、(uuid)、(字符串数组)、(字符串)、(字符串)、(对象)、(日期时间)、(int32)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_atGet an MDR usage report
获取MDR使用报告
Fetch single MDR usage report by id.
GET /legacy/reporting/usage_reports/messaging/{id}javascript
const messaging = await client.legacy.reporting.usageReports.messaging.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(messaging.data);Returns: (int32), (array[string]), (date-time), (date-time), (uuid), (array[string]), (string), (string), (object), (date-time), (int32), (date-time)
aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_at通过ID获取单个MDR使用报告。
GET /legacy/reporting/usage_reports/messaging/{id}javascript
const messaging = await client.legacy.reporting.usageReports.messaging.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(messaging.data);返回:(int32)、(字符串数组)、(日期时间)、(日期时间)、(uuid)、(字符串数组)、(字符串)、(字符串)、(对象)、(日期时间)、(int32)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_atDelete a V2 legacy usage MDR report request
删除V2旧版MDR使用报告请求
Deletes a specific V2 legacy usage MDR report request by ID
DELETE /legacy/reporting/usage_reports/messaging/{id}javascript
const messaging = await client.legacy.reporting.usageReports.messaging.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(messaging.data);Returns: (int32), (array[string]), (date-time), (date-time), (uuid), (array[string]), (string), (string), (object), (date-time), (int32), (date-time)
aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_at通过ID删除特定的V2旧版MDR使用报告请求
DELETE /legacy/reporting/usage_reports/messaging/{id}javascript
const messaging = await client.legacy.reporting.usageReports.messaging.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(messaging.data);返回:(int32)、(字符串数组)、(日期时间)、(日期时间)、(uuid)、(字符串数组)、(字符串)、(字符串)、(对象)、(日期时间)、(int32)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidprofilesrecord_typereport_urlresultstart_timestatusupdated_atList telco data usage reports
列出电信数据使用报告
Retrieve a paginated list of telco data usage reports
GET /legacy/reporting/usage_reports/number_lookupjavascript
const numberLookups = await client.legacy.reporting.usageReports.numberLookup.list();
console.log(numberLookups.data);Returns: (string), (date-time), (date), (uuid), (array[string]), (string), (string), (array[object]), (date), (string), (date-time)
aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_at检索电信数据使用报告的分页列表
GET /legacy/reporting/usage_reports/number_lookupjavascript
const numberLookups = await client.legacy.reporting.usageReports.numberLookup.list();
console.log(numberLookups.data);返回:(字符串)、(日期时间)、(日期)、(uuid)、(字符串数组)、(字符串)、(字符串)、(对象数组)、(日期)、(字符串)、(日期时间)
aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_atSubmit telco data usage report
提交电信数据使用报告
Submit a new telco data usage report
POST /legacy/reporting/usage_reports/number_lookupjavascript
const numberLookup = await client.legacy.reporting.usageReports.numberLookup.create();
console.log(numberLookup.data);Returns: (string), (date-time), (date), (uuid), (array[string]), (string), (string), (array[object]), (date), (string), (date-time)
aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_at提交新的电信数据使用报告
POST /legacy/reporting/usage_reports/number_lookupjavascript
const numberLookup = await client.legacy.reporting.usageReports.numberLookup.create();
console.log(numberLookup.data);返回:(字符串)、(日期时间)、(日期)、(uuid)、(字符串数组)、(字符串)、(字符串)、(对象数组)、(日期)、(字符串)、(日期时间)
aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_atGet telco data usage report by ID
通过ID获取电信数据使用报告
Retrieve a specific telco data usage report by its ID
GET /legacy/reporting/usage_reports/number_lookup/{id}javascript
const numberLookup = await client.legacy.reporting.usageReports.numberLookup.retrieve('550e8400-e29b-41d4-a716-446655440000');
console.log(numberLookup.data);Returns: (string), (date-time), (date), (uuid), (array[string]), (string), (string), (array[object]), (date), (string), (date-time)
aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_at通过ID检索特定的电信数据使用报告
GET /legacy/reporting/usage_reports/number_lookup/{id}javascript
const numberLookup = await client.legacy.reporting.usageReports.numberLookup.retrieve('550e8400-e29b-41d4-a716-446655440000');
console.log(numberLookup.data);返回:(字符串)、(日期时间)、(日期)、(uuid)、(字符串数组)、(字符串)、(字符串)、(对象数组)、(日期)、(字符串)、(日期时间)
aggregation_typecreated_atend_dateidmanaged_accountsrecord_typereport_urlresultstart_datestatusupdated_atDelete telco data usage report
删除电信数据使用报告
Delete a specific telco data usage report by its ID
DELETE /legacy/reporting/usage_reports/number_lookup/{id}javascript
await client.legacy.reporting.usageReports.numberLookup.delete('550e8400-e29b-41d4-a716-446655440000');通过ID删除特定的电信数据使用报告
DELETE /legacy/reporting/usage_reports/number_lookup/{id}javascript
await client.legacy.reporting.usageReports.numberLookup.delete('550e8400-e29b-41d4-a716-446655440000');List CDR usage reports
列出CDR使用报告
Fetch all previous requests for cdr usage reports.
GET /legacy/reporting/usage_reports/voicejavascript
// Automatically fetches more pages as needed.
for await (const cdrUsageReportResponseLegacy of client.legacy.reporting.usageReports.voice.list()) {
console.log(cdrUsageReportResponseLegacy.id);
}Returns: (int32), (array[string]), (date-time), (date-time), (uuid), (int32), (string), (string), (object), (date-time), (int32), (date-time)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_at获取所有CDR使用报告的历史请求。
GET /legacy/reporting/usage_reports/voicejavascript
// Automatically fetches more pages as needed.
for await (const cdrUsageReportResponseLegacy of client.legacy.reporting.usageReports.voice.list()) {
console.log(cdrUsageReportResponseLegacy.id);
}返回:(int32)、(字符串数组)、(日期时间)、(日期时间)、(uuid)、(int32)、(字符串)、(字符串)、(对象)、(日期时间)、(int32)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atCreate a new legacy usage V2 CDR report request
创建新的旧版V2 CDR使用报告请求
Creates a new legacy usage V2 CDR report request with the specified filters
POST /legacy/reporting/usage_reports/voicejavascript
const voice = await client.legacy.reporting.usageReports.voice.create({
end_time: '2024-02-01T00:00:00Z',
start_time: '2024-02-01T00:00:00Z',
});
console.log(voice.data);Returns: (int32), (array[string]), (date-time), (date-time), (uuid), (int32), (string), (string), (object), (date-time), (int32), (date-time)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_at使用指定筛选条件创建新的旧版V2 CDR使用报告请求
POST /legacy/reporting/usage_reports/voicejavascript
const voice = await client.legacy.reporting.usageReports.voice.create({
end_time: '2024-02-01T00:00:00Z',
start_time: '2024-02-01T00:00:00Z',
});
console.log(voice.data);返回:(int32)、(字符串数组)、(日期时间)、(日期时间)、(uuid)、(int32)、(字符串)、(字符串)、(对象)、(日期时间)、(int32)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atGet a CDR usage report
获取CDR使用报告
Fetch single cdr usage report by id.
GET /legacy/reporting/usage_reports/voice/{id}javascript
const voice = await client.legacy.reporting.usageReports.voice.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(voice.data);Returns: (int32), (array[string]), (date-time), (date-time), (uuid), (int32), (string), (string), (object), (date-time), (int32), (date-time)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_at通过ID获取单个CDR使用报告。
GET /legacy/reporting/usage_reports/voice/{id}javascript
const voice = await client.legacy.reporting.usageReports.voice.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(voice.data);返回:(int32)、(字符串数组)、(日期时间)、(日期时间)、(uuid)、(int32)、(字符串)、(字符串)、(对象)、(日期时间)、(int32)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atDelete a V2 legacy usage CDR report request
删除V2旧版CDR使用报告请求
Deletes a specific V2 legacy usage CDR report request by ID
DELETE /legacy/reporting/usage_reports/voice/{id}javascript
const voice = await client.legacy.reporting.usageReports.voice.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(voice.data);Returns: (int32), (array[string]), (date-time), (date-time), (uuid), (int32), (string), (string), (object), (date-time), (int32), (date-time)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_at通过ID删除特定的V2旧版CDR使用报告请求
DELETE /legacy/reporting/usage_reports/voice/{id}javascript
const voice = await client.legacy.reporting.usageReports.voice.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(voice.data);返回:(int32)、(字符串数组)、(日期时间)、(日期时间)、(uuid)、(int32)、(字符串)、(字符串)、(对象)、(日期时间)、(int32)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atList CSV downloads
列出CSV下载
GET /phone_numbers/csv_downloadsjavascript
// Automatically fetches more pages as needed.
for await (const csvDownload of client.phoneNumbers.csvDownloads.list()) {
console.log(csvDownload.id);
}Returns: (string), (string), (enum: pending, complete, failed, expired), (string)
idrecord_typestatusurlGET /phone_numbers/csv_downloadsjavascript
// Automatically fetches more pages as needed.
for await (const csvDownload of client.phoneNumbers.csvDownloads.list()) {
console.log(csvDownload.id);
}返回:(字符串)、(字符串)、(枚举:pending, complete, failed, expired)、(字符串)
idrecord_typestatusurlCreate a CSV download
创建CSV下载
POST /phone_numbers/csv_downloadsjavascript
const csvDownload = await client.phoneNumbers.csvDownloads.create();
console.log(csvDownload.data);Returns: (string), (string), (enum: pending, complete, failed, expired), (string)
idrecord_typestatusurlPOST /phone_numbers/csv_downloadsjavascript
const csvDownload = await client.phoneNumbers.csvDownloads.create();
console.log(csvDownload.data);返回:(字符串)、(字符串)、(枚举:pending, complete, failed, expired)、(字符串)
idrecord_typestatusurlRetrieve a CSV download
检索CSV下载
GET /phone_numbers/csv_downloads/{id}javascript
const csvDownload = await client.phoneNumbers.csvDownloads.retrieve('550e8400-e29b-41d4-a716-446655440000');
console.log(csvDownload.data);Returns: (string), (string), (enum: pending, complete, failed, expired), (string)
idrecord_typestatusurlGET /phone_numbers/csv_downloads/{id}javascript
const csvDownload = await client.phoneNumbers.csvDownloads.retrieve('550e8400-e29b-41d4-a716-446655440000');
console.log(csvDownload.data);返回:(字符串)、(字符串)、(枚举:pending, complete, failed, expired)、(字符串)
idrecord_typestatusurlGenerates and fetches CDR Usage Reports
生成并获取CDR使用报告
Generate and fetch voice usage report synchronously. This endpoint will both generate and fetch the voice report over a specified time period. No polling is necessary but the response may take up to a couple of minutes.
GET /reports/cdr_usage_reports/syncjavascript
const response = await client.reports.cdrUsageReports.fetchSync({
aggregation_type: 'NO_AGGREGATION',
product_breakdown: 'NO_BREAKDOWN',
});
console.log(response.data);Returns: (enum: NO_AGGREGATION, CONNECTION, TAG, BILLING_GROUP), (array[integer]), (date-time), (date-time), (uuid), (enum: NO_BREAKDOWN, DID_VS_TOLL_FREE, COUNTRY, DID_VS_TOLL_FREE_PER_COUNTRY), (string), (string), (object), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_at同步生成并获取语音使用报告。该端点会在指定时间段内生成并获取语音报告,无需轮询,但响应可能需要几分钟时间。
GET /reports/cdr_usage_reports/syncjavascript
const response = await client.reports.cdrUsageReports.fetchSync({
aggregation_type: 'NO_AGGREGATION',
product_breakdown: 'NO_BREAKDOWN',
});
console.log(response.data);返回:(枚举:NO_AGGREGATION, CONNECTION, TAG, BILLING_GROUP)、(整数数组)、(日期时间)、(日期时间)、(uuid)、(枚举:NO_BREAKDOWN, DID_VS_TOLL_FREE, COUNTRY, DID_VS_TOLL_FREE_PER_COUNTRY)、(字符串)、(字符串)、(对象)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
aggregation_typeconnectionscreated_atend_timeidproduct_breakdownrecord_typereport_urlresultstart_timestatusupdated_atFetch all Messaging usage reports
获取所有消息使用报告
Fetch all messaging usage reports. Usage reports are aggregated messaging data for specified time period and breakdown
GET /reports/mdr_usage_reportsjavascript
// Automatically fetches more pages as needed.
for await (const mdrUsageReport of client.reports.mdrUsageReports.list()) {
console.log(mdrUsageReport.id);
}Returns: (enum: NO_AGGREGATION, PROFILE, TAGS), (array[integer]), (date-time), (date-time), (uuid), (string), (string), (string), (array[object]), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_at获取所有消息使用报告。使用报告是指定时间段内的聚合消息数据及细分信息
GET /reports/mdr_usage_reportsjavascript
// Automatically fetches more pages as needed.
for await (const mdrUsageReport of client.reports.mdrUsageReports.list()) {
console.log(mdrUsageReport.id);
}返回:(枚举:NO_AGGREGATION, PROFILE, TAGS)、(整数数组)、(日期时间)、(日期时间)、(uuid)、(字符串)、(字符串)、(字符串)、(对象数组)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atCreate MDR Usage Report
创建MDR使用报告
Submit request for new new messaging usage report. This endpoint will pull and aggregate messaging data in specified time period.
POST /reports/mdr_usage_reportsjavascript
const mdrUsageReport = await client.reports.mdrUsageReports.create({
aggregation_type: 'NO_AGGREGATION',
end_date: '2020-07-01T00:00:00-06:00',
start_date: '2020-07-01T00:00:00-06:00',
});
console.log(mdrUsageReport.data);Returns: (enum: NO_AGGREGATION, PROFILE, TAGS), (array[integer]), (date-time), (date-time), (uuid), (string), (string), (string), (array[object]), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_at提交新的消息使用报告请求。该端点会提取并聚合指定时间段内的消息数据。
POST /reports/mdr_usage_reportsjavascript
const mdrUsageReport = await client.reports.mdrUsageReports.create({
aggregation_type: 'NO_AGGREGATION',
end_date: '2020-07-01T00:00:00-06:00',
start_date: '2020-07-01T00:00:00-06:00',
});
console.log(mdrUsageReport.data);返回:(枚举:NO_AGGREGATION, PROFILE, TAGS)、(整数数组)、(日期时间)、(日期时间)、(uuid)、(字符串)、(字符串)、(字符串)、(对象数组)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atGenerate and fetch MDR Usage Report
生成并获取MDR使用报告
Generate and fetch messaging usage report synchronously. This endpoint will both generate and fetch the messaging report over a specified time period. No polling is necessary but the response may take up to a couple of minutes.
GET /reports/mdr_usage_reports/syncjavascript
const response = await client.reports.mdrUsageReports.fetchSync({ aggregation_type: 'PROFILE' });
console.log(response.data);Returns: (enum: NO_AGGREGATION, PROFILE, TAGS), (array[integer]), (date-time), (date-time), (uuid), (string), (string), (string), (array[object]), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_at同步生成并获取消息使用报告。该端点会在指定时间段内生成并获取消息报告,无需轮询,但响应可能需要几分钟时间。
GET /reports/mdr_usage_reports/syncjavascript
const response = await client.reports.mdrUsageReports.fetchSync({ aggregation_type: 'PROFILE' });
console.log(response.data);返回:(枚举:NO_AGGREGATION, PROFILE, TAGS)、(整数数组)、(日期时间)、(日期时间)、(uuid)、(字符串)、(字符串)、(字符串)、(对象数组)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atRetrieve messaging report
检索消息报告
Fetch a single messaging usage report by id
GET /reports/mdr_usage_reports/{id}javascript
const mdrUsageReport = await client.reports.mdrUsageReports.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(mdrUsageReport.data);Returns: (enum: NO_AGGREGATION, PROFILE, TAGS), (array[integer]), (date-time), (date-time), (uuid), (string), (string), (string), (array[object]), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_at通过ID获取单个消息使用报告
GET /reports/mdr_usage_reports/{id}javascript
const mdrUsageReport = await client.reports.mdrUsageReports.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(mdrUsageReport.data);返回:(枚举:NO_AGGREGATION, PROFILE, TAGS)、(整数数组)、(日期时间)、(日期时间)、(uuid)、(字符串)、(字符串)、(字符串)、(对象数组)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atDelete MDR Usage Report
删除MDR使用报告
Delete messaging usage report by id
DELETE /reports/mdr_usage_reports/{id}javascript
const mdrUsageReport = await client.reports.mdrUsageReports.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(mdrUsageReport.data);Returns: (enum: NO_AGGREGATION, PROFILE, TAGS), (array[integer]), (date-time), (date-time), (uuid), (string), (string), (string), (array[object]), (date-time), (enum: PENDING, COMPLETE, FAILED, EXPIRED), (date-time)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_at通过ID删除消息使用报告
DELETE /reports/mdr_usage_reports/{id}javascript
const mdrUsageReport = await client.reports.mdrUsageReports.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(mdrUsageReport.data);返回:(枚举:NO_AGGREGATION, PROFILE, TAGS)、(整数数组)、(日期时间)、(日期时间)、(uuid)、(字符串)、(字符串)、(字符串)、(对象数组)、(日期时间)、(枚举:PENDING, COMPLETE, FAILED, EXPIRED)、(日期时间)
aggregation_typeconnectionscreated_atend_dateidprofilesrecord_typereport_urlresultstart_datestatusupdated_atFetch all Mdr records
获取所有MDR记录
GET /reports/mdrsjavascript
const response = await client.reports.listMdrs();
console.log(response.data);Returns: (string), (string), (string), (date-time), (enum: AUD, CAD, EUR, GBP, USD), (string), (string), (enum: SMS, MMS), (number), (string), (string), (string), (enum: GW_TIMEOUT, DELIVERED, DLR_UNCONFIRMED, DLR_TIMEOUT, RECEIVED, GW_REJECT, FAILED)
cldclicostcreated_atcurrencydirectionidmessage_typepartsprofile_nameraterecord_typestatusGET /reports/mdrsjavascript
const response = await client.reports.listMdrs();
console.log(response.data);返回:(字符串)、(字符串)、(字符串)、(日期时间)、(枚举:AUD, CAD, EUR, GBP, USD)、(字符串)、(字符串)、(枚举:SMS, MMS)、(数字)、(字符串)、(字符串)、(字符串)、(枚举:GW_TIMEOUT, DELIVERED, DLR_UNCONFIRMED, DLR_TIMEOUT, RECEIVED, GW_REJECT, FAILED)
cldclicostcreated_atcurrencydirectionidmessage_typepartsprofile_nameraterecord_typestatusFetches all Wdr records
获取所有WDR记录
Fetch all Wdr records
GET /reports/wdrsjavascript
// Automatically fetches more pages as needed.
for await (const reportListWdrsResponse of client.reports.listWdrs()) {
console.log(reportListWdrsResponse.id);
}Returns: (object), (date-time), (object), (number), (string), (string), (string), (string), (string), (object), (string), (string), (string), (string), (object)
costcreated_atdownlink_dataduration_secondsidimsimccmncphone_numberraterecord_typesim_card_idsim_group_idsim_group_nameuplink_data获取所有WDR记录
GET /reports/wdrsjavascript
// Automatically fetches more pages as needed.
for await (const reportListWdrsResponse of client.reports.listWdrs()) {
console.log(reportListWdrsResponse.id);
}返回:(对象)、(日期时间)、(对象)、(数字)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)、(字符串)、(字符串)、(对象)
costcreated_atdownlink_dataduration_secondsidimsimccmncphone_numberraterecord_typesim_card_idsim_group_idsim_group_nameuplink_dataGet metadata overview
获取元数据概览
Returns all available record types and supported query parameters for session analysis.
GET /session_analysis/metadatajavascript
const metadata = await client.sessionAnalysis.metadata.retrieve();
console.log(metadata.meta);Returns: (object), (object), (array[object])
metaquery_parametersrecord_types返回所有可用记录类型及会话分析支持的查询参数。
GET /session_analysis/metadatajavascript
const metadata = await client.sessionAnalysis.metadata.retrieve();
console.log(metadata.meta);返回:(对象)、(对象)、(对象数组)
metaquery_parametersrecord_typesGet record type metadata
获取记录类型元数据
Returns detailed metadata for a specific record type, including relationships and examples.
GET /session_analysis/metadata/{record_type}javascript
const response = await client.sessionAnalysis.metadata.retrieveRecordType('record_type');
console.log(response.aliases);Returns: (array[string]), (array[object]), (string), (object), (object), (array[object]), (string), (string)
aliaseschild_relationshipseventexamplesmetaparent_relationshipsproductrecord_type返回特定记录类型的详细元数据,包括关联关系和示例。
GET /session_analysis/metadata/{record_type}javascript
const response = await client.sessionAnalysis.metadata.retrieveRecordType('record_type');
console.log(response.aliases);返回:(字符串数组)、(对象数组)、(字符串)、(对象)、(对象)、(对象数组)、(字符串)、(字符串)
aliaseschild_relationshipseventexamplesmetaparent_relationshipsproductrecord_typeGet session analysis
获取会话分析
Retrieves a full session analysis tree for a given event, including costs, child events, and product linkages.
GET /session_analysis/{record_type}/{event_id}javascript
const sessionAnalysis = await client.sessionAnalysis.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ record_type: 'record_type' },
);
console.log(sessionAnalysis.session_id);Returns: (date-time), (object), (date-time), (object), (object), (string), (string)
completed_atcostcreated_atmetarootsession_idstatus检索给定事件的完整会话分析树,包括成本、子事件和产品关联。
GET /session_analysis/{record_type}/{event_id}javascript
const sessionAnalysis = await client.sessionAnalysis.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ record_type: 'record_type' },
);
console.log(sessionAnalysis.session_id);返回:(日期时间)、(对象)、(日期时间)、(对象)、(对象)、(字符串)、(字符串)
completed_atcostcreated_atmetarootsession_idstatusGet Telnyx product usage data (BETA)
获取Telnyx产品使用数据(测试版)
Get Telnyx usage data by product, broken out by the specified dimensions
GET /usage_reportsjavascript
// Automatically fetches more pages as needed.
for await (const usageReportListResponse of client.usageReports.list({
dimensions: ['string'],
metrics: ['string'],
product: 'wireless',
})) {
console.log(usageReportListResponse);
}Returns: (array[object]), (object)
datameta按产品获取Telnyx使用数据,并按指定维度细分
GET /usage_reportsjavascript
// Automatically fetches more pages as needed.
for await (const usageReportListResponse of client.usageReports.list({
dimensions: ['string'],
metrics: ['string'],
product: 'wireless',
})) {
console.log(usageReportListResponse);
}返回:(对象数组)、(对象)
datametaGet Usage Reports query options (BETA)
获取使用报告查询选项(测试版)
Get the Usage Reports options for querying usage, including the products available and their respective metrics and dimensions
GET /usage_reports/optionsjavascript
const response = await client.usageReports.getOptions();
console.log(response.data);Returns: (string), (array[string]), (array[string]), (array[object])
productproduct_dimensionsproduct_metricsrecord_types获取用于查询使用情况的使用报告选项,包括可用产品及其对应的指标和维度
GET /usage_reports/optionsjavascript
const response = await client.usageReports.getOptions();
console.log(response.data);返回:(字符串)、(字符串数组)、(字符串数组)、(对象数组)
productproduct_dimensionsproduct_metricsrecord_typesGet all Wireless Detail Records (WDRs) Reports
获取所有无线详细记录(WDR)报告
Returns the WDR Reports that match the given parameters.
GET /wireless/detail_records_reportsjavascript
const detailRecordsReports = await client.wireless.detailRecordsReports.list();
console.log(detailRecordsReports.data);Returns: (string), (string), (uuid), (string), (string), (string), (enum: pending, complete, failed, deleted), (string)
created_atend_timeidrecord_typereport_urlstart_timestatusupdated_at返回匹配给定参数的WDR报告。
GET /wireless/detail_records_reportsjavascript
const detailRecordsReports = await client.wireless.detailRecordsReports.list();
console.log(detailRecordsReports.data);返回:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举:pending, complete, failed, deleted)、(字符串)
created_atend_timeidrecord_typereport_urlstart_timestatusupdated_atCreate a Wireless Detail Records (WDRs) Report
创建无线详细记录(WDR)报告
Asynchronously create a report containing Wireless Detail Records (WDRs) for the SIM cards that consumed wireless data in the given time period.
POST /wireless/detail_records_reportsOptional: (string), (string)
end_timestart_timejavascript
const detailRecordsReport = await client.wireless.detailRecordsReports.create();
console.log(detailRecordsReport.data);Returns: (string), (string), (uuid), (string), (string), (string), (enum: pending, complete, failed, deleted), (string)
created_atend_timeidrecord_typereport_urlstart_timestatusupdated_at异步创建包含指定时间段内消耗无线数据的SIM卡的无线详细记录(WDR)报告。
POST /wireless/detail_records_reports可选参数:(字符串)、(字符串)
end_timestart_timejavascript
const detailRecordsReport = await client.wireless.detailRecordsReports.create();
console.log(detailRecordsReport.data);返回:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举:pending, complete, failed, deleted)、(字符串)
created_atend_timeidrecord_typereport_urlstart_timestatusupdated_atGet a Wireless Detail Record (WDR) Report
获取无线详细记录(WDR)报告
Returns one specific WDR report
GET /wireless/detail_records_reports/{id}javascript
const detailRecordsReport = await client.wireless.detailRecordsReports.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(detailRecordsReport.data);Returns: (string), (string), (uuid), (string), (string), (string), (enum: pending, complete, failed, deleted), (string)
created_atend_timeidrecord_typereport_urlstart_timestatusupdated_at返回特定的WDR报告
GET /wireless/detail_records_reports/{id}javascript
const detailRecordsReport = await client.wireless.detailRecordsReports.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(detailRecordsReport.data);返回:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举:pending, complete, failed, deleted)、(字符串)
created_atend_timeidrecord_typereport_urlstart_timestatusupdated_atDelete a Wireless Detail Record (WDR) Report
删除无线详细记录(WDR)报告
Deletes one specific WDR report.
DELETE /wireless/detail_records_reports/{id}javascript
const detailRecordsReport = await client.wireless.detailRecordsReports.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(detailRecordsReport.data);Returns: (string), (string), (uuid), (string), (string), (string), (enum: pending, complete, failed, deleted), (string)
created_atend_timeidrecord_typereport_urlstart_timestatusupdated_at删除特定的WDR报告。
DELETE /wireless/detail_records_reports/{id}javascript
const detailRecordsReport = await client.wireless.detailRecordsReports.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(detailRecordsReport.data);返回:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举:pending, complete, failed, deleted)、(字符串)
created_atend_timeidrecord_typereport_urlstart_timestatusupdated_at