import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.usageReports.getOptions();
console.log(response.data);{
"data": [
{
"product": "wireless",
"product_dimensions": [
"mnc",
"mcc",
"sim_card_id",
"sim_group_name"
],
"product_metrics": [
"uplink_data_bytes",
"downlink_data",
"downlink_data_bytes",
"uplink_data",
"data_cost"
],
"record_types": [
{
"record_type": "conversation_event",
"product_dimensions": [
"direction",
"currency",
"message_type"
],
"product_metrics": [
"cost",
"billed_sec"
]
}
]
}
]
}Get the Usage Reports options for querying usage, including the products available and their respective metrics and dimensions
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.usageReports.getOptions();
console.log(response.data);{
"data": [
{
"product": "wireless",
"product_dimensions": [
"mnc",
"mcc",
"sim_card_id",
"sim_group_name"
],
"product_metrics": [
"uplink_data_bytes",
"downlink_data",
"downlink_data_bytes",
"uplink_data",
"data_cost"
],
"record_types": [
{
"record_type": "conversation_event",
"product_dimensions": [
"direction",
"currency",
"message_type"
],
"product_metrics": [
"cost",
"billed_sec"
]
}
]
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Authenticates the request with your Telnyx API V2 KEY
Options (dimensions and metrics) for a given product. If none specified, all products will be returned.
Successful
An object following one of the schemas published in https://developers.telnyx.com/docs/api/v2/detail-records
Collection of product description
Show child attributes
Telnyx Product
"wireless"
Telnyx Product Dimensions
[
"mnc",
"mcc",
"sim_card_id",
"sim_group_name"
]Telnyx Product Metrics
[
"uplink_data_bytes",
"downlink_data",
"downlink_data_bytes",
"uplink_data",
"data_cost"
]Subproducts if applicable
Show child attributes
Was this page helpful?