Successful response with a list of messaging profile metrics.
Array of objects (MessagingProfileHighLevelMetrics) | |
object (PaginationMeta) |
{- "data": [
- {
- "inbound": {
- "received": 850
}, - "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "outbound": {
- "delivered": 990,
- "errors": 0.01,
- "sent": 1000
}, - "phone_numbers": 250,
- "record_type": "messaging_profile_metrics"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
Successful response with a list of messaging profiles.
Array of objects (MessagingProfile) | |
object (PaginationMeta) |
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.MessagingProfile.list(page={"number":1,"size":20})
{- "data": [
- {
- "created_at": "2019-01-23T18:10:02.574Z",
- "enabled": true,
- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "name": "Profile for Messages",
- "number_pool_settings": {
- "geomatch": false,
- "long_code_weight": 2,
- "skip_unhealthy": false,
- "sticky_sender": true,
- "toll_free_weight": 10
}, - "record_type": "messaging_profile",
- "updated_at": "2019-01-23T18:10:02.574Z",
- "url_shortener_settings": {
- "domain": "example.ex",
- "prefix": "cmpny",
- "replace_blacklist_only": true,
- "send_webhooks": false
}, - "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
- "webhook_api_version": "2",
- "whitelisted_destinations": [
- "US"
]
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
New Messaging Profile object
Successful response with details about a messaging profile.
{- "enabled": true,
- "name": "My name",
- "number_pool_settings": {
- "geomatch": false,
- "long_code_weight": 1,
- "skip_unhealthy": true,
- "sticky_sender": false,
- "toll_free_weight": 10
}, - "url_shortener_settings": {
- "domain": "example.ex",
- "prefix": "",
- "replace_blacklist_only": true,
- "send_webhooks": false
}, - "webhook_api_version": "2",
}
{- "data": {
- "created_at": "2019-01-23T18:10:02.574Z",
- "enabled": true,
- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "name": "Profile for Messages",
- "number_pool_settings": {
- "geomatch": false,
- "long_code_weight": 2,
- "skip_unhealthy": false,
- "sticky_sender": true,
- "toll_free_weight": 10
}, - "record_type": "messaging_profile",
- "updated_at": "2019-01-23T18:10:02.574Z",
- "url_shortener_settings": {
- "domain": "example.ex",
- "prefix": "cmpny",
- "replace_blacklist_only": true,
- "send_webhooks": false
}, - "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
- "webhook_api_version": "2",
- "whitelisted_destinations": [
- "US"
]
}
}
{- "data": {
- "event_type": "message.sent",
- "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "occurred_at": "date-time",
- "payload": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "organization_id": "b448f9cc-a842-4784-98e9-03c1a5872950",
- "parts": 1,
- "received_at": "2019-01-23T18:10:02.574Z",
- "record_type": "message",
- "sent_at": null,
- "subject": "From Telnyx!",
- "tags": [
- "Greetings"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}, - "record_type": "event"
},
}
Successful response with details about a messaging profile.
object (MessagingProfile) | |||||||||||||||||||||||||||
|
import telnyx telnyx.api_key = "YOUR_API_KEY" res = telnyx.MessagingProfile.retrieve('id') res.delete()
{- "data": {
- "created_at": "2019-01-23T18:10:02.574Z",
- "enabled": true,
- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "name": "Profile for Messages",
- "number_pool_settings": {
- "geomatch": false,
- "long_code_weight": 2,
- "skip_unhealthy": false,
- "sticky_sender": true,
- "toll_free_weight": 10
}, - "record_type": "messaging_profile",
- "updated_at": "2019-01-23T18:10:02.574Z",
- "url_shortener_settings": {
- "domain": "example.ex",
- "prefix": "cmpny",
- "replace_blacklist_only": true,
- "send_webhooks": false
}, - "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
- "webhook_api_version": "2",
- "whitelisted_destinations": [
- "US"
]
}
}
Successful response with details about a messaging profile.
object (MessagingProfile) | |||||||||||||||||||||||||||
|
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.MessagingProfile.retrieve("id")
{- "data": {
- "created_at": "2019-01-23T18:10:02.574Z",
- "enabled": true,
- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "name": "Profile for Messages",
- "number_pool_settings": {
- "geomatch": false,
- "long_code_weight": 2,
- "skip_unhealthy": false,
- "sticky_sender": true,
- "toll_free_weight": 10
}, - "record_type": "messaging_profile",
- "updated_at": "2019-01-23T18:10:02.574Z",
- "url_shortener_settings": {
- "domain": "example.ex",
- "prefix": "cmpny",
- "replace_blacklist_only": true,
- "send_webhooks": false
}, - "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
- "webhook_api_version": "2",
- "whitelisted_destinations": [
- "US"
]
}
}
New Messaging Profile object
enabled | boolean Specifies whether the messaging profile is enabled or not. |
name | string A user friendly name for the messaging profile. |
object (NumberPoolSettings) Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile. To disable this feature, set the object field to | |
object (UrlShortenerSettings) The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability. To disable this feature, set the object field to | |
v1_secret | string Secret used to authenticate with v1 endpoints. |
webhook_api_version | string Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format. |
webhook_failover_url | string <url> The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails. |
webhook_url | string <url> The URL where webhooks related to this messaging profile will be sent. |
whitelisted_destinations | Array of strings Destinations to which the messaging profile is allowed to send. If set to |
Successful response with details about a messaging profile.
object (MessagingProfile) | |||||||||||||||||||||||||||
|
{- "enabled": true,
- "name": "Updated Profile for Messages",
- "number_pool_settings": {
- "geomatch": false,
- "long_code_weight": 2,
- "skip_unhealthy": false,
- "sticky_sender": true,
- "toll_free_weight": 10
}, - "url_shortener_settings": {
- "domain": "example.ex",
- "prefix": "cmpny",
- "replace_blacklist_only": true,
- "send_webhooks": false
}, - "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
- "webhook_api_version": "2",
- "whitelisted_destinations": [
- "US"
]
}
{- "data": {
- "created_at": "2019-01-23T18:10:02.574Z",
- "enabled": true,
- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "name": "Profile for Messages",
- "number_pool_settings": {
- "geomatch": false,
- "long_code_weight": 2,
- "skip_unhealthy": false,
- "sticky_sender": true,
- "toll_free_weight": 10
}, - "record_type": "messaging_profile",
- "updated_at": "2019-01-23T18:10:02.574Z",
- "url_shortener_settings": {
- "domain": "example.ex",
- "prefix": "cmpny",
- "replace_blacklist_only": true,
- "send_webhooks": false
}, - "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
- "webhook_api_version": "2",
- "whitelisted_destinations": [
- "US"
]
}
}
Successful response with details about a messaging profile's metrics.
object (MessagingProfileDetailedMetrics) | |||||
|
{- "data": {
- "detailed": [
- {
- "metrics": [
- {
- "delivered": 990,
- "errors": 0.01,
- "label": "longcode",
- "received": 750,
- "sent": 1000
}
], - "timestamp": "2019-01-23T18:10:02.574Z"
}
], - "overview": {
- "inbound": {
- "received": 850
}, - "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "outbound": {
- "delivered": 990,
- "errors": 0.01,
- "sent": 1000
}, - "phone_numbers": 250,
- "record_type": "messaging_profile_metrics"
}
}
}
Successful response with a list of messaging profile phone numbers.
Array of objects (PhoneNumberWithMessagingSettings) | |
object (PaginationMeta) |
import telnyx telnyx.api_key = "YOUR_API_KEY" mp = telnyx.MessagingProfile.retrieve("uuid") mp.phone_numbers()
{- "data": [
- {
- "country_code": "US",
- "created_at": "2019-01-23T18:10:02.574Z",
- "eligible_messaging_products": [
- "A2P"
], - "features": {
- "mms": null,
- "sms": {
- "domestic_two_way": true,
- "international_inbound": true,
- "international_outbound": true
}
}, - "health": {
- "inbound_outbound_ratio": 0.43,
- "message_count": 122,
- "spam_ratio": 0.06,
- "success_ratio": 0.94
}, - "id": "1293384261075731499",
- "messaging_product": "A2P",
- "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "phone_number": "+18005550001",
- "record_type": "messaging_settings",
- "traffic_type": "A2P",
- "type": "toll-free",
- "updated_at": "2019-01-23T18:10:02.574Z"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
Successful response with a list of messaging profile short codes.
Array of objects (ShortCode) | |
object (PaginationMeta) |
import telnyx telnyx.api_key = "YOUR_API_KEY" mp = telnyx.MessagingProfile.retrieve("uuid") mp.short_codes()
{- "data": [
- {
- "country_code": "US",
- "created_at": "2019-01-23T18:10:02.574Z",
- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "record_type": "short_code",
- "short_code": "12345",
- "updated_at": "2019-01-23T18:10:02.574Z"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}