List messages
This endpoint lists messages.
curl --request GET \
--url https://api.sendo.dev/v1/message/list \
--header 'Authorization: Bearer <token>'
{
"messages": [
{
"id": "f7d258bd-f697-4840-b8a6-165707e12345",
"type": "SMS",
"createdAt": "2023-09-19T04:55:50.723Z",
"sentAt": "2023-09-19T04:55:50.723Z",
"updatedAt": "2023-09-19T04:55:55.884Z",
"direction": "INBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Incoming message",
"numSegments": 1,
"campaignId": "U7fQ3123",
"status": "DELIVERED"
},
{
"id": "f7d258bd-f697-4840-b8a6-165707e12123",
"type": "MMS",
"createdAt": "2023-09-19T04:55:50.723Z",
"sentAt": "2023-09-19T04:55:50.723Z",
"updatedAt": "2023-09-19T04:55:55.884Z",
"direction": "INBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Another incoming message",
"mediaUrls": ["https://example.com/image.jpg"],
"numSegments": 1,
"campaignId": "U7fQ3123",
"metadata": {
"customId": "123456789"
},
"status": "DELIVERED"
},
And so on...
]
}
URL Params
The ID of the campaign to list messages from.
The number of messages to return (default 10).
The number of messages to skip (i.e. offset).
Return either INBOUND
or OUTBOUND
messages.
Return messages to/from a specific number.
Response
An array of message objects returned.
The ID of the retrieved message.
Message type. Either SMS
or MMS
.
The time that the message was created.
The time that the message was sent.
The time of the most recent status update.
The time the message is scheduled for (optional).
Message direction. Either INBOUND
or OUTBOUND
.
The number that the message was sent from.
The number that the message was sent to.
The body of the message.
Array of media URLs attached to the message.
Object with user-defined key-value pairs.
Number of message segments sent (see guide).
The error code (if the message fails).
The error message (if the message fails).
ID of the campaign that the message was sent from.
The status of the message.
The message has been created.
The message is queued for sending.
The message is scheduled for sending.
The message has been sent.
The message has been delivered.
The message has been opened.
The message send has failed.
The send has failed after too many attempts.
Error message if the request fails.
Errors
If the request fails, it will return an HTTP error status code and an error
field in the response body with details. Full list of status codes here.
{
"messages": [
{
"id": "f7d258bd-f697-4840-b8a6-165707e12345",
"type": "SMS",
"createdAt": "2023-09-19T04:55:50.723Z",
"sentAt": "2023-09-19T04:55:50.723Z",
"updatedAt": "2023-09-19T04:55:55.884Z",
"direction": "INBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Incoming message",
"numSegments": 1,
"campaignId": "U7fQ3123",
"status": "DELIVERED"
},
{
"id": "f7d258bd-f697-4840-b8a6-165707e12123",
"type": "MMS",
"createdAt": "2023-09-19T04:55:50.723Z",
"sentAt": "2023-09-19T04:55:50.723Z",
"updatedAt": "2023-09-19T04:55:55.884Z",
"direction": "INBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Another incoming message",
"mediaUrls": ["https://example.com/image.jpg"],
"numSegments": 1,
"campaignId": "U7fQ3123",
"metadata": {
"customId": "123456789"
},
"status": "DELIVERED"
},
And so on...
]
}
curl --request GET \
--url https://api.sendo.dev/v1/message/list \
--header 'Authorization: Bearer <token>'
{
"messages": [
{
"id": "f7d258bd-f697-4840-b8a6-165707e12345",
"type": "SMS",
"createdAt": "2023-09-19T04:55:50.723Z",
"sentAt": "2023-09-19T04:55:50.723Z",
"updatedAt": "2023-09-19T04:55:55.884Z",
"direction": "INBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Incoming message",
"numSegments": 1,
"campaignId": "U7fQ3123",
"status": "DELIVERED"
},
{
"id": "f7d258bd-f697-4840-b8a6-165707e12123",
"type": "MMS",
"createdAt": "2023-09-19T04:55:50.723Z",
"sentAt": "2023-09-19T04:55:50.723Z",
"updatedAt": "2023-09-19T04:55:55.884Z",
"direction": "INBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Another incoming message",
"mediaUrls": ["https://example.com/image.jpg"],
"numSegments": 1,
"campaignId": "U7fQ3123",
"metadata": {
"customId": "123456789"
},
"status": "DELIVERED"
},
And so on...
]
}