List Contacts

GET/api/v2/contacts

Base URL https://api.easify.liveBearer token and Accept header required Authentication →

This endpoint is used to retrieve user's contacts.

The user can retrieve their contacts, including those in shared contact groups, with a default pagination limit of 10 if no limit is specified.

There is a rate limit of 60 requests per minute per API token. This limit is shared by all API endpoints except those with their own separate limit (/api/v2/sms/send, /api/v3/sms/send, etc.), so requests to other endpoints also count toward it. If you exceed this limit, you will receive a 429 Too Many Requests status, along with a message indicating when you can try again.

Query Parameters

limit integer Pagination for contacts list (Default :10, Max :50) Optional
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
group_id integer If the user sends a specific group_id, filter out the contacts of that group Optional

Example Request and Response

params

{
  "page": 2,
  "limit": 1,
  "order": "asc"
}

Success Response:

{
  "status": true,
  "message": "Contacts",
  "data": [
    {
      "id": 1,
      "group_name": "My Contact Group",
      "first_name": "Easify",
      "last_name": "App",
      "phone_number": "+1289434****",
      "email_address": "easify@easify.app",
      "company": "company",
      "additional_1": "one",
      "additional_2": "two",
      "additional_3": "three",
      "shared_contact": true,
      "created_at": "12-02-2024 03:34:30 AM",
      "updated_at": "12-02-2024 03:34:30 AM"
    }
  ],
  "links": {
    "first": "https://api.easify.live/api/v2/contacts?page=1",
    "last": "https://api.easify.live/api/v2/contacts?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "https://api.easify.live/api/v2/contacts?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "hhttps://api.easify.live/api/v2/contacts",
    "per_page": 3,
    "to": 1,
    "total": 1
  }
}
  • The shared_contact is a Boolean field that indicates whether the contact is in the main user's shared contact group.

Responses

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

List your contacts
php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://api.easify.live/api/v2/contacts?limit=1&order=asc&page=2',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <>',
    'Accept: application/json',
  ],
]);

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

echo $response;