List All Messages
GET/Accounts/:AccountSid/Messages
Returns a paged list of messages sorted with the most recent messages appearing first.
Permissions
The API token must include the following scopes: Messaging.
Request
Path Parameters
The unique identifier of the project that sent or received this message.
Query Parameters
Possible values: [queued
, sending
, sent
, delivered
, undelivered
, failed
, receiving
, received
]
Responses
- 200
OK
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
messages
object[]
The unique identifier of the project that sent or received this message.
The version number of the SignalWire cXML REST API used to handle this message.
The text of the message. Up to 1600 characters long and can be null if no message was sent.
The number of segments that make up the entire message. If the body of the message is larger than 160 GSM-7 characters or 70 UCS-2 characters, it will automatically be broken up into smaller messages and annotated to attempt proper reconstruction on the recipient handset. Not all carriers and handsets support this. SignalWire will recombine inbound messages into a single message. Your project will be charged for each segment sent or received.
The number of media files that were included with the message.
The date and time the message was created in RFC 2822 format.
The date and time the message was sent in RFC 2822 format.
The date and time the message was last updated in RFC 2822 format.
Possible values: [inbound
, outbound-api
, outbound-call
, outbound-reply
]
The direction of the message.
If an error has occurred on the message, the error code will give you a specific code to help lookup more information on the failure. If no error occurred, error_code
will be null.
A human readable description of the error that occurred. If no error occurred, error_message
will be null.
The phone number in E.164 format. For inbound messages, this will be the remote phone number who sent the message. For outbound messages, this will be one of your SignalWire phone numbers.
The cost of the individual message billed to your project.
The currency in which price
is charged as.
A unique ID that identifies this specific message.
Possible values: [queued
, sending
, sent
, delivered
, undelivered
, failed
, receiving
, received
]
Current status of the message.
The phone number in E.164 format that received the message. For inbound messages, this is one of your SignalWire phone numbers; for outbound messages, this is the remote phone number that received the message.
If a number group was used when sending an outbound message, the number group's ID will be present. If no number group was used, the value will be null.
The URI of this particular message.
subresource_uris
object
The URIs for any subresources associated with this message.
{
"uri": "string",
"first_page_uri": "string",
"next_page_uri": "string",
"previous_page_uri": "string",
"page": 0,
"page_size": 0,
"messages": [
{
"account_sid": "ea108133-d6b3-407c-9536-9fad8a929a6a",
"api_version": "2010-04-01",
"body": "Hello World!",
"num_segments": "1",
"num_media": 1,
"date_created": "Mon, 13 Aug 2018 21:38:46 +0000",
"date_sent": "null",
"date_updated": "Mon, 13 Aug 2018 21:38:46 +0000",
"direction": "outbound-api",
"error_code": null,
"error_message": null,
"from": "+15551234567",
"price": "0.005",
"price_unit": "USD",
"sid": "0a059168-ead0-41af-9d1f-343dae832527",
"status": "sent",
"to": "+15557654321",
"messaging_service_sid": "null",
"uri": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527",
"subresource_uris": {
"media": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527/Media"
}
}
]
}