import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.reports.listMdrs();
console.log(response.data);{
"data": [
{
"created_at": "2020-07-01T00:00:00-06:00",
"profile_name": "configured-profile-name",
"direction": "outbound",
"parts": 2,
"status": "DELIVERED",
"cld": "+1555123456",
"cli": "+1555123456",
"rate": "0.05",
"cost": "0.1",
"currency": "USD",
"id": "99b637f3-07fd-45ac-b9ca-b87208c24650",
"message_type": "SMS",
"record_type": "mdr_report"
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}Fetch all Mdr records
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.reports.listMdrs();
console.log(response.data);{
"data": [
{
"created_at": "2020-07-01T00:00:00-06:00",
"profile_name": "configured-profile-name",
"direction": "outbound",
"parts": 2,
"status": "DELIVERED",
"cld": "+1555123456",
"cli": "+1555123456",
"rate": "0.05",
"cost": "0.1",
"currency": "USD",
"id": "99b637f3-07fd-45ac-b9ca-b87208c24650",
"message_type": "SMS",
"record_type": "mdr_report"
}
],
"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.
Pagination start date
Pagination end date
Message uuid
"e093fbe0-5bde-11eb-ae93-0242ac130002"
Direction (inbound or outbound)
INBOUND, OUTBOUND "INBOUND"
Name of the profile
"My profile"
Destination number
"+15551237654"
Origination number
"+15551237654"
Message status
GW_TIMEOUT, DELIVERED, DLR_UNCONFIRMED, DLR_TIMEOUT, RECEIVED, GW_REJECT, FAILED "DELIVERED"
Type of message
SMS, MMS "SMS"
Successful
Show child attributes
Message sent time
"2020-07-01T00:00:00-06:00"
Configured profile name. New profiles can be created and configured on Telnyx portal
"configured-profile-name"
Direction of message - inbound or outbound.
"outbound"
Number of parts this message has. Max number of character is 160. If message contains more characters then that it will be broken down in multiple parts
2
Message status
GW_TIMEOUT, DELIVERED, DLR_UNCONFIRMED, DLR_TIMEOUT, RECEIVED, GW_REJECT, FAILED "DELIVERED"
The destination number for a call, or the callee
"+1555123456"
The number associated with the person initiating the call, or the caller
"+1555123456"
Rate applied to the message
"0.05"
Final cost. Cost is calculated as rate * parts
"0.1"
Currency of the rate and cost
AUD, CAD, EUR, GBP, USD "USD"
Id of message detail record
"99b637f3-07fd-45ac-b9ca-b87208c24650"
Type of message
SMS, MMS "SMS"
"mdr_report"
Was this page helpful?