SMS Report
GET
/api/v2/sms/report Base URL https://api.easify.liveBearer token and Accept header required Authentication →
This endpoint is used to retrieve user's sms reports.
The user can retrieve their SMS reports in response, with a default pagination limit of 10 if no limit is specified, and a maximum of 30 days of data.
This endpoint has its own rate limit of 20 requests per minute per API token, separate from the other endpoints. If you exceed this limit, you will receive a 429 Too Many Requests status, along with a message indicating when you can try again.
The authenticated user must have access to the SMS feature. Requests made without the proper feature permissions will receive a 490 status code response, indicating that a plan upgrade is required.Query Parameters
| from_date string | The start date of the time frame for fetching data. This should be provided in the YYYY-MM-DD format. | Required |
| to_date string | The end date of the time frame for fetching data. This should be provided in the YYYY-MM-DD format. | Required |
| limit integer | Pagination for SMS Report data (Default :10, Maximum: 100) | Optional |
| status string | Filters the data based on the specified status(Pending, Success, Delivered, Undelivered,Failed, Scheduled) | Optional |
| sender string | Filters the data based on the sender's phone number(Sender number associated with the API token.) | Optional |
| receiver string | Filters the data based on the receiver's phone number Note: If the receiver field is provided, the country_code field must be provided | Required with country_code |
| order string | Specifies the order in which the data should be sorted. Use asc for ascending order and desc for descending order; the default is desc | Optional |
| page integer | The page number for paginated data | Optional |
| country_code string | Receiver’s country code ( eg: +1, +972 ) Note: If the country code is provided, the receiver field must be provided. | Required with receiver |
Example Request and Response
Params:
{
"page": 2,
"limit": 2,
"order": "desc",
"from_date": "2024-10-01",
"to_date": "2024-10-30",
"status": "Success",
"sender": "+1315444****",
"receiver": "313451****",
"country_code": "+1"
}
Success Response:
{
"status": true,
"message": "SMS Report",
"data": [
{
"id": 183900,
"sender": "+1315444****",
"receiver": "+1313451****",
"message": "Hai",
"sms_type": "sms",
"send_by": "sender",
"media_url": "null",
"status": "Failed",
"created_at": "10-15-2024 05:36:32 PM",
"reason": ""
}
],
"links": {
"first": "https://api.easify.live/api/v2/sms/report?page=2",
"last": "https://api.easify.live/api/v2/sms/report?page=50",
"prev": null,
"next": "https://api.easify.live/api/v2/sms/report?page=3"
},
"meta": {
"current_page": 2,
"from": 4,
"last_page": 50,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://api.easify.live/api/v2/sms/report?page=1",
"label": "1",
"active": true
}
],
"path": "https://api.easify.live/api/v2/sms/report",
"per_page": 2,
"to": 1,
"total": 200
}
}
Responses
| Case | Status Code | Response |
|---|---|---|
| If the user provides an invalid Easify API token or does not pass the Easify API token in the header. | 401 |
{
"status": false,
"message":"Unauthenticated",
"errors": []
}
|
| If from date and to date is more than 30 days | 400 |
{
"status": false,
"message": "The date range cannot exceed 30 days.",
"errors": []
}
|
| If the user exceeds the allowed rate limit for requests | 429 |
{
"status":false,
"message":"Too many requests. Try again in 59 seconds",
"errors":[]
}
|
| If the user's subscription has ended | 402 |
{
"status":false,"message":"You need to recharge your account to proceed","errors":[]
}
|
| If the user provides a pagination limit greater than 100 | 422 |
{
"message": "The limit field must not be greater than 100.",
"errors": {
"limit": [
"The limit field must not be greater than 100."
]
}
}
|
| When the user account is inactive | 403 |
{
"status": false,
"message": "Your account is currently inactive.",
"errors": []
}
|
| If the request comes from an IP address or domain that is not on the account's API whitelist | 400 |
{
"status": false,
"message": "Access denied! Your IP or domain is not whitelisted.[ HostName : ] - [ Ip Address : << YOUR_SERVER_IP >>]",
"errors": []
}
|
Code Examples
Retrieve SMS reports
php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.easify.live/api/v2/sms/report?from_date=2024-12-03&to_date=2024-12-30',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <> ',
'Accept: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;