GET / voice-call/history

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


This endpoint retrieves the user's call history, including from, to, status, recording URLand other details about the calls. The results are returned as a paginated collection of records.

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 string The original phone number of the call Optional
to array The destination phone number(s) of the call(maximum array size: 100) Optional
from_date string The start date to filter calls (in YYYY-MM-DDformat). Optional
to_date string The end date to filter calls (in YYYY-MM-DDformat). Optional
public_call boolean The public_call filter only returns public call history data Optional
limit integer The number of records per page for pagination.Defaults to 10 if not provided. Optional
order string The sorting order of the records. Use asc for ascending or desc for descending order. Defaults to desc if not provided. Optional
page integer The page number to retrieve. Defaults to 1 if not provided. Optional
include_subusers boolean If the authenticated user is an owner, they can fetch subuser's data by using the filter key include_subusers. Set include_subusers to true to fetch subuser's data. Optional

Sample Params and Success Response:

Params:

{
  "from": "+1234567****",
  "to": "+1987654****",
  "from_date": "2024-12-01",
  "to_date": "2024-12-15",
  "public_call": true,
  "include_subusers": true,
  "limit": 10,
  "order": "desc",
  "page": 1
}

Success Response:

{
  "status": true,
  "message": "Call History",
  "data": [
    {
      "id": "838**",
      "user_name": "John Smith",
      "user_type": "owner",
      "from": "+123456****",
      "to": "+098765****",
      "type": "Outgoing Call",
      "status": "Completed",
      "recording_url": "https://api.twilio.com/2010-04-01/Accounts/AC3d20aa30fae99d1054fec3ea33da674239/Recordings/RE877123abcc9a1afe3131f715a4c4*****",
      "duration": "3",
      "is_public_call": 1, 
      "created_at": "2024-12-10 10:15:30"
    },
    {
      "id": "838**",
      "user_name": "Cooper",
      "user_type": "sub_user",
      "from": "+987654****",
      "to": "+123456****",
      "type": "Outgoing Call",
      "status": "Missed",
      "recording_url": "https://api.twilio.com/2010-04-01/Accounts/AC3d20aa30fae99d1054fec3ea33da674239/Recordings/RE877123abcc9a1afe3131f715a4c4*****",
      "duration": "3",
      "is_public_call": 1, 
      "created_at": "2024-12-11 14:05:20"
    }
  ],
  "links": {
    "first": "https://backend.easify.app/api/v2/voice-call/history?page=1",
    "last": "https://backend.easify.app/api/v2/voice-call/history?page=61",
    "prev": "https://backend.easify.app/api/v2/voice-call/history?page=1",
    "next": "https://backend.easify.app/api/v2/voice-call/history?page=3"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 61,
    "links": [
      {
        "url": "https://backend.easify.app/api/v2/voice-call/history?page=2",
        "label": "Next »",
        "active": false
      }
    ],
    "path": "https://backend.easify.app/api/v2/voice-call/history",
    "per_page": 10,
    "to": 10,
    "total": 610
  }
}

Api Response Status

Case Status Code Response
If the user does not provide a token in the header or provides an invalid token 401 { "status":false, "message":"Unauthenticated", "errors":[] }
An invalid value was passed to the 'to' field instead of an array 400 { "message": "The to field must be an array.", "errors": { "to": ["The to field must be an array."] } }
Invalid from_date or to_date format 400 { "status": false, "message": "Invalid date format", "errors": { "from_date": ["Invalid date"] } }
Invalid limit or page 400 { "status": false, "message": "Invalid pagination parameters", "errors": { "limit": ["min:1"] } }
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": [] }

Response Explanation

  • Id: Unique identifier for the call
  • form: The phone number the call originated from.
  • to: The phone number the call was made to.
  • type: The type of the call (e.g., "Outgoing Call", "Incoming Call")
  • status: The call status (e.g., "Completed", "Missed").
  • recording_url: A URL to the call recording (if available).
  • duration: The call duration in Seconds (e.g., "3 seconds").
  • created_at: The timestamp of when the call occurred.
  • is_public_api: Indicates whether the call was initiated through the public API (If the response is 1, it means that the call was initiated through the public API)
  • user_type: The user_type specifies whether the user is a sub_user or an owner.
  • user_name: The user_name indicates the specific user's full name.

PHP-cURL

php
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => 'https://backend.easify.app/api/v2/voice-call/history?from=+1320301****&to[]=+1321252****',
  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