GET / sms/report

Base URL: https://backend.easify.app/api/v2


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.

There is a rate limit of 60 requests per minute. If you exceed this limit, you will receive a 429 Too Many Requests status, along with a message indicating when you can try again.

Authentication

The Easify API token used for authentication is passed in the header as a Bearer token, which can be obtained from the easify app under Settings > API Settings.

Headers

Authorization string required Bearer << YOUR_EASIFY_API_TOKEN_HERE >>

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 phone numbers list(Default :10) 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 and the number without the country code.) 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

Sample Params and Response:

Params:

{
  "page": 2,
  "limit": 2,
  "order": "desc",
  "from_date": "2024-10-01",
  "to_date": "2024-10-30",
  "status": "Success",
  "sender": "315444****",
  "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://backend.easify.app/api/v2/sms/report?page=2",
    "last": "https://backend.easify.app/api/v2/sms/report?page=50",
    "prev": null,
    "next": "https://backend.easify.app/api/v2/sms/report?page=3"
  },
  "meta": {
    "current_page": 2,
    "from": 4,
    "last_page": 50,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "https://backend.easify.app/api/v2/sms/report?page=1",
        "label": "1",
        "active": true
      }
    ],
    "path": "https://backend.easify.app/api/v2/sms/report",
    "per_page": 2,
    "to": 1,
    "total": 200
  }
}
Easify DNC Registry and chat block will not prevent sending SMS; they only block blacklisted numbers

Api Response Status

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 does not have an enterprise plan 403 { "status": false, "message": "Access denied. Your current plan does not allow access to this feature. Please upgrade to the Enterprise plan.", "errors": [] }

PHP-cURL

php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://backend.easify.app/api/v2/sms/report?from_date=2024-12-03&to_date=2024-12-30',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer 1955|43da5bb5-5c2b-4059-a4de-d44bf5*****'
  ],
]);
$response = curl_exec($curl);
curl_close($curl);

echo $response;

pixel for linkedin