SMS Details
Retrieve the details and delivery status of a specific SMS message.
Path Parameters
| Parameter | Required | Description |
|---|---|---|
SmsSid | Mandatory | The unique SMS identifier returned when the message was sent |
Code Examples
- cURL
- Python
- Node.js
- PHP
- Go
curl -u '<api_key>:<api_token>' https://api.exotel.com/v1/Accounts/<your_sid>/SMS/Messages/<SmsSid>.json
import requests
response = requests.get(
'https://api.exotel.com/v1/Accounts/<your_sid>/SMS/Messages/<SmsSid>.json',
auth=('<api_key>', '<api_token>')
)
print(response.json())
const apiKey = '<your_api_key>';
const apiToken = '<your_api_token>';
const accountSid = '<your_sid>';
const url = `https://api.exotel.com/v1/Accounts/${accountSid}/SMS/Messages/<SmsSid>.json`;
const response = await fetch(url, {
headers: {
'Authorization': 'Basic ' + Buffer.from(`${apiKey}:${apiToken}`).toString('base64'),
},
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_USERPWD => "<api_key>:<api_token>",
CURLOPT_URL => "https://api.exotel.com/v1/Accounts/<your_sid>/SMS/Messages/<SmsSid>.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array("Content-Type: application/json"),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.exotel.com/v1/Accounts/<your_sid>/SMS/Messages/<SmsSid>.json"
req, _ := http.NewRequest("GET", url, nil)
req.SetBasicAuth("<api_key>", "<api_token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
Response
{
"SMSMessage": {
"Sid": "sms_sid_value",
"AccountSid": "your_sid",
"From": "EXOTEL",
"To": "+919876543210",
"Body": "Your OTP is 123456",
"Status": "sent",
"DetailedStatusCode": 20005,
"DetailedStatus": "DELIVERED_TO_HANDSET",
"DateCreated": "2024-01-15 10:30:00",
"DateUpdated": "2024-01-15 10:30:05",
"DateSent": "2024-01-15 10:30:02",
"Price": 0.18,
"Uri": "/v1/Accounts/your_sid/SMS/Messages/sms_sid_value"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
Sid | String | Unique SMS identifier |
Status | String | High-level status: queued, sending, submitted, sent, failed, failed-dnd |
DetailedStatusCode | Integer | Numeric status code (see Status Codes) |
DetailedStatus | String | Human-readable status description |
DateCreated | DateTime | When the request was received |
DateSent | DateTime | When the SMS was sent to the operator |
DateUpdated | DateTime | Last status update timestamp |
Price | Double | Amount charged |
Error Codes
| HTTP Code | API Error Code | Scenario |
|---|---|---|
| 200 | — | SID not found — returns "No matching results" (not a 404) |
| 429 | 40403 | Too many GET requests |
| 400 | 40501 | Invalid parameters in the request URL |
| 403 | 40002 | Account inactive |
| 401 | — | Auth key or token missing |
| 401 | 34010 | Invalid auth key or token |
| 403 | 34009 | Account SID missing or action forbidden on resource |
note
A 200 response with "No matching results" means the SID was not found — this is not an error HTTP status code.