Sub User Tokens

GET/api/v2/sub-user/tokens

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

This endpoint is used to fetch the Easify API tokens of sub users from the main user

The main user can fetch the Easify API tokens of subusers using this API. If a specific email ID is provided, only that user's token will be returned. Otherwise, all subusers' tokens will be returned in a paginated format.

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

email string Specific Email id of subuser Optional
limit string Limit for pagination (Default: 10, Max: 50) Optional
All parameters should be URL encoded to ensure they are correctly transmitted. Forexample, the + character must be encoded as %2B

Example Request and Response

Params:

{
  "email": "easify@app.com"
}

Success Response:

{
  "message": "Sub Users",
  "status": true,
  "data": [
    {
      "email": "easify@app.com",
      "name": "Sub User Easify",
      "easify_api_token": "1234|xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  ],
  "links": {
    "first": "https://api.easify.live/api/v2/sub-user/tokens?page=1",
    "last": "https://api.easify.live/api/v2/sub-user/tokens?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/sub-user/tokens?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "https://api.easify.live/api/v2/sub-user/tokens",
    "per_page": 10,
    "to": 1,
    "total": 1
  }
}

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 user not provided invalid email id 400 { "status": false, "message": "No sub users associated with this email address!", "errors": [] }
If there is no subusers for the mainuser 400 { "status": false, "message": "No sub users found!", "errors": [] }
When a subuser tries to access this API 400 { "status": false, "message": "Access denied: Subusers do not have the required permissions to perform this action. Please contact an administrator for assistance.", "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

Fetch sub-user tokens
php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://api.easify.live/api/v2/sub-user/tokens?email=easify@app.com',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <>',
    'Accept: application/json',
  ],
]);

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

echo $response;