API Requests with an Access Token

The received access token must be passed in the Authorization header in the format "Bearer <access_token>" in each API request.
Example header: Authorization: Bearer ykX7vsJstZkUh1x3hG5sIeRgRaICMm

The request parameters are passed in the application/x-www-form-urlencoded (content-type: application/x-www-form-urlencoded) format, and the request body (if available) is passed in the application/json (content-type: application/json) format. This rule is executed with some exceptions: for example, when using the POST method in the "Fax" and "Sound Files" resources, the request body is transmitted in the multipart/form-data format (content-type: multipart/form-data).

Requests to the API will be made on behalf of and with the permissions of the user who granted access to the PBX application. If an authorization error occurred while using the token, it is recommended to request the token again, even if the time specified in the expires_in field has not yet passed before the token expires.

Example of a request to get information about an authorized user:

System response:

{ "dealer_id": null, "admin": false, "extra_params": null, "access": "full", "extension_id": null, "client_id": 12,   "extension_group_id": null,   "timezone": "Europe/Moscow",   "login": "client1",   "id": 20 }

 

← Authorization of PBX Applications Using the User's Username and Password

Using the Regeneration Token (Refresh Token) →