List messages
curl --request GET \
--url https://api.sendo.dev/v1/message/list \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sendo.dev/v1/message/list"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sendo.dev/v1/message/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sendo.dev/v1/message/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sendo.dev/v1/message/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sendo.dev/v1/message/list")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendo.dev/v1/message/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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...
]
}
{
"messages": null,
"error": "Internal server error"
}
Message
List messages
This endpoint lists messages.
GET
/
v1
/
message
/
list
List messages
curl --request GET \
--url https://api.sendo.dev/v1/message/list \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sendo.dev/v1/message/list"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sendo.dev/v1/message/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sendo.dev/v1/message/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sendo.dev/v1/message/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sendo.dev/v1/message/list")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendo.dev/v1/message/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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...
]
}
{
"messages": null,
"error": "Internal server error"
}
URL Params
string
required
The ID of the campaign to list messages from.
number
The number of messages to return (default 10).
number
The number of messages to skip (i.e. offset).
string
Return either
INBOUND or OUTBOUND messages.string
Return messages to/from a specific number.
Response
[message]
An array of message objects returned.
Show message fields
Show message fields
string
required
The ID of the retrieved message.
string
required
Message type. Either
SMS or MMS.timestamp
required
The time that the message was created.
timestamp or null
The time that the message was sent.
timestamp or null
The time of the most recent status update.
timestamp or null
The time the message is scheduled for (optional).
string
required
Message direction. Either
INBOUND or OUTBOUND.string
required
The number that the message was sent from.
string
required
The number that the message was sent to.
string
required
The body of the message.
[string]
Array of media URLs attached to the message.
object
Object with user-defined key-value pairs.
number
required
Number of message segments sent (see guide).
number or null
The error code (if the message fails).
string or null
The error message (if the message fails).
string
required
ID of the campaign that the message was sent from.
string
required
The status of the message.
Show message statuses
Show message statuses
string
The message has been created.
string
The message is queued for sending.
string
The message is scheduled for sending.
string
The message has been sent.
string
The message has been delivered.
string
The message has been opened.
string
The message send has failed.
string
The send has failed after too many attempts.
string
Error message if the request fails.
Errors
If the request fails, it will return an HTTP error status code and anerror 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...
]
}
{
"messages": null,
"error": "Internal server error"
}
⌘I

