Get SMS Delivery Status
The Get SMS Delivery Status method allows you to get detailed information about a specific SMS message by its unique identifier.
Important!
The maximum number of SMS messages that can be checked per request is 100.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"ids": [
"5d91537bd132dsf45916520a",
"5bc0a73d19b6051f963023c2",
"5bc0a73d19b6051f963023c3"
]
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
ids required
|
array |
List of |
Response
{
"result":true,
"data":{
"5d91537bd132fdf45916520a":{
"id":"5d91537bd132fdf45916520a",
"status":"delivered",
"createdAt":"2019-09-30 00:59:39",
"text":"Hi, user! Your phone: +15555555 Var1: apiVar1Val",
"phoneNumber":"+15555555",
"fromName":"Sender name"
},
"5 bc0a73d19b6051f963023c2":null,
"5bc0a73d19b6051f963023c3":null
},
"errors":[
"SMS 5bc0a73d19b6051f963023c2 not found",
"SMS 5bc0a73d19b6051f963023c3 not found"
]
}
Parameters
Title | Type | Description |
---|---|---|
Return value |
object |
You will get a list of successfully fetched ids and list of errors for failed ones. |
result |
boolean |
The value indicates that the request was successful:
|
data |
object |
An array of fetched information. |
data.id |
string |
sms_id of the message. |
data.status |
string |
The send status is assigned as soon as Wooxy sends the SMS, and it is accepted by the recipient ISP server:
|
data.createdAt |
string |
Message creation UTC DateTime. |
data.text |
string |
The content of the SMS. |
data.phoneNumber |
string |
recipient’s phone number |
data.fronName |
string |
Sender name used in the SMS |
erorrs |
array |
An array of failed id fetches and error messages with description of why request was rejected. |
Method Errors
{
"result": false,
"errors": [
"Error description text"
]
}
Error |
---|
“Argument ids must be an array of strings” |
“Argument ids can not be empty” |
“each id must be a non-empty string” |
“ids count must be less or equal 100” |
“Invalid authorization token!” |
“Internal server error” |
“Bad Request” |
“no matches found for access token {accessToken}” |
“user {id} not enabled” |
“no data found for key {userId}” |
“access token check failed for key\/secret $key\/$accessToken” |
“Argument {argument} required” |
Code Examples
$accessToken = "YOUR_API_KEY";
$url = 'https://api.wooxy.comv3/sms/info';
$body = json_encode([
'ids' => [
'5bc0a73d19b6051f963023c1',
'5bc0a73d19b6051f963023c2',
'5bc0a73d19b6051f963023c3',
],
]);
/**
* Request Example
*/
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Access-Token: $accessToken",
'Content-Type: application/json',
'Content-Length: ' . strlen($body),
]);
$result = curl_exec($ch);
if ($result === false) {
echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
echo strval($result) . PHP_EOL;
}
curl_close($ch);