import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const messagings = await client.mobilePhoneNumbers.messaging.list();
console.log(messagings.data);{
"data": [
{
"record_type": "messaging_settings",
"id": "2126210528794641864",
"phone_number": "++13127367407",
"messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"country_code": "US",
"type": "longcode",
"traffic_type": "P2P",
"messaging_product": "P2P",
"features": {
"sms": {
"domestic_two_way": true,
"international_inbound": true,
"international_outbound": true
}
}
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const messagings = await client.mobilePhoneNumbers.messaging.list();
console.log(messagings.data);{
"data": [
{
"record_type": "messaging_settings",
"id": "2126210528794641864",
"phone_number": "++13127367407",
"messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"country_code": "US",
"type": "longcode",
"traffic_type": "P2P",
"messaging_product": "P2P",
"features": {
"sms": {
"domestic_two_way": true,
"international_inbound": true,
"international_outbound": true
}
}
}
],
"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.
Successful response with a list of mobile phone numbers with messaging settings.
Show child attributes
Identifies the type of the resource.
messaging_phone_number, messaging_settings "messaging_settings"
Identifies the type of resource.
+E.164 formatted phone number.
Unique identifier for a messaging profile.
ISO 8601 formatted date indicating when the resource was created.
ISO 8601 formatted date indicating when the resource was updated.
ISO 3166-1 alpha-2 country code.
"US"
The type of the phone number
longcode The messaging traffic or use case for which the number is currently configured.
"P2P"
The messaging product that the number is registered to use
"P2P"
Show child attributes
The set of features available for a specific messaging use case (SMS or MMS). Features can vary depending on the characteristics the phone number, as well as its current product configuration.
Show child attributes
Send messages to and receive messages from numbers in the same country.
Receive messages from numbers in other countries.
Send messages to numbers in other countries.
{
"domestic_two_way": true,
"international_inbound": false,
"international_outbound": true
}Was this page helpful?