import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const messaging = await client.phoneNumbers.messaging.update('id');
console.log(messaging.data);{
"data": {
"record_type": "messaging_settings",
"id": "1293384261075731499",
"phone_number": "+18005550001",
"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": "toll-free",
"health": {
"message_count": 122,
"inbound_outbound_ratio": 0.43,
"success_ratio": 0.94,
"spam_ratio": 0.06
},
"eligible_messaging_products": [
"A2P"
],
"traffic_type": "A2P",
"messaging_product": "A2P",
"features": {
"sms": {
"domestic_two_way": true,
"international_inbound": true,
"international_outbound": true
},
"mms": null
}
}
}import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const messaging = await client.phoneNumbers.messaging.update('id');
console.log(messaging.data);{
"data": {
"record_type": "messaging_settings",
"id": "1293384261075731499",
"phone_number": "+18005550001",
"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": "toll-free",
"health": {
"message_count": 122,
"inbound_outbound_ratio": 0.43,
"success_ratio": 0.94,
"spam_ratio": 0.06
},
"eligible_messaging_products": [
"A2P"
],
"traffic_type": "A2P",
"messaging_product": "A2P",
"features": {
"sms": {
"domestic_two_way": true,
"international_inbound": true,
"international_outbound": true
},
"mms": null
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The phone number to update.
The new configuration to set for this phone number.
To avoid modifying a value, either omit the field or set its value to null.
Configure the messaging profile this phone number is assigned to:
null to keep the current value."" to unassign the number from its messaging profileConfigure the messaging product for this number:
null to keep the current value."P2P"
Successful response with details about a phone number including 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
long-code, toll-free, short-code, longcode, tollfree, shortcode High level health metrics about the number and it's messaging sending patterns.
Show child attributes
The number of messages analyzed for the health metrics.
The ratio of messages received to the number of messages sent.
The ratio of messages sucessfully delivered to the number of messages attempted.
The ratio of messages blocked for spam to the number of messages attempted.
{
"message_count": 10,
"inbound_outbound_ratio": 1,
"success_ratio": 2,
"spam_ratio": 10
}The messaging products that this number can be registered to use
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
}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
}{
"record_type": "messaging_settings",
"id": "1293384261075731499",
"phone_number": "+18005550001",
"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": "toll-free",
"health": {
"message_count": 122,
"inbound_outbound_ratio": 0.43,
"success_ratio": 0.94,
"spam_ratio": 0.06
},
"eligible_messaging_products": ["A2P"],
"traffic_type": "A2P",
"messaging_product": "A2P",
"features": {
"sms": {
"domestic_two_way": true,
"international_inbound": true,
"international_outbound": true
},
"mms": null
}
}Was this page helpful?