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.

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.

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 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

Sample Params 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://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
  }
}

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 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": [] }

Code Examples

Retrieve SMS reports
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_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <>',
    'Accept: application/json',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;

pixel for linkedin