Retrieve message
curl --request GET \
--url https://api.sendo.dev/v1/message/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sendo.dev/v1/message/{id}"
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/{id}', 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/{id}",
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/{id}"
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/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendo.dev/v1/message/{id}")
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{
"message": {
"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": "OUTBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Hello world",
"numSegments": 1,
"campaignId": "U7fQ3123",
"metadata": {
"customId": "123456789"
},
"status": "DELIVERED"
}
}
{
"message": null,
"error": "Message not found"
}
Message
Retrieve message
This endpoint retrieves a message.
GET
/
v1
/
message
/
{id}
Retrieve message
curl --request GET \
--url https://api.sendo.dev/v1/message/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sendo.dev/v1/message/{id}"
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/{id}', 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/{id}",
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/{id}"
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/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendo.dev/v1/message/{id}")
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{
"message": {
"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": "OUTBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Hello world",
"numSegments": 1,
"campaignId": "U7fQ3123",
"metadata": {
"customId": "123456789"
},
"status": "DELIVERED"
}
}
{
"message": null,
"error": "Message not found"
}
Parameters
string
required
The ID of the message to retrieve.
Response
object
The contents of the message.
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.
{
"message": {
"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": "OUTBOUND",
"from": "+14159436397",
"to": "+12061234567",
"body": "Hello world",
"numSegments": 1,
"campaignId": "U7fQ3123",
"metadata": {
"customId": "123456789"
},
"status": "DELIVERED"
}
}
{
"message": null,
"error": "Message not found"
}
⌘I

