Retrieve a message
GET/messages/:id
Note: This API endpoint can only retrieve messages that are no older than 10 days since their creation. If you require messages older than this, please generate an MDR report.
Request
Path Parameters
The id of the message
Responses
200: Successful response with details about a message.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
Array [
]
Array [
]
data
object
Possible values: [message
]
Identifies the type of the resource.
Possible values: [outbound
]
The direction of the message. Inbound messages are sent to you whereas outbound messages are sent from you.
Identifies the type of resource.
Possible values: [SMS
, MMS
]
The type of message.
Unique identifier for a messaging profile.
The id of the organization the messaging profile belongs to.
from
object
Sending address (+E.164 formatted phone number, alphanumeric sender ID, or short code).
The carrier of the receiver.
Possible values: [Wireline
, Wireless
, VoWiFi
, VoIP
, Pre-Paid Wireless
, ``]
The line-type of the receiver.
to
object[]
Receiving address (+E.164 formatted phone number or short code).
Possible values: [queued
, sending
, sent
, expired
, sending_failed
, delivery_unconfirmed
, delivered
, delivery_failed
]
The delivery status of the message.
The carrier of the receiver.
Possible values: [Wireline
, Wireless
, VoWiFi
, VoIP
, Pre-Paid Wireless
, ``]
The line-type of the receiver.
Message body (i.e., content) as a non-empty string.
Required for SMS
Subject of multimedia message
media
object[]
The url of the media requested to be sent.
The MIME type of the requested media.
The SHA256 hash of the requested media.
The size of the requested media.
The URL where webhooks related to this message will be sent.
The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.
Encoding scheme used for the message body.
Possible values: >= 1
and <= 10
Number of parts into which the message's body must be split.
Tags associated with the resource.
cost
object
nullable
The amount deducted from your account.
The ISO 4217 currency identifier.
ISO 8601 formatted date indicating when the message request was received.
ISO 8601 formatted date indicating when the message was sent.
ISO 8601 formatted date indicating when the message was finalized.
Message must be out of the queue by this time or else it will be discarded and marked as 'sending_failed'. Once the message moves out of the queue, this field will be nulled
errors
Error[]
These errors may point at addressees when referring to unsuccessful/unconfirmed delivery statuses.
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
These errors may point at addressees when referring to unsuccessful/unconfirmed delivery statuses.
{
"data": {
"record_type": "message",
"direction": "outbound",
"id": "40385f64-5717-4562-b3fc-2c963f66afa6",
"type": "MMS",
"messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
"organization_id": "b448f9cc-a842-4784-98e9-03c1a5872950",
"from": {
"phone_number": "+18445550001",
"carrier": "TELNYX LLC",
"line_type": "VoIP"
},
"to": [
{
"phone_number": "+18665550001",
"status": "queued",
"carrier": "T-MOBILE USA, INC.",
"line_type": "Wireless"
}
],
"text": "Hello, World!",
"subject": "From Telnyx!",
"media": [
{
"url": "https://pbs.twimg.com/profile_images/1142168442042118144/AW3F4fFD_400x400.png",
"content_type": null,
"sha256": null,
"size": null
}
],
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://backup.example.com/hooks",
"encoding": "GSM-7",
"parts": 1,
"tags": [
"Greetings"
],
"cost": null,
"received_at": "2019-01-23T18:10:02.574Z",
"sent_at": null,
"completed_at": null,
"valid_until": null,
"errors": []
}
}
default: Unexpected error
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
Error[]
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}