Application authorization in requests to REST API Bitrix
Create your Bitrix24 on https://www.bitrix24.ru
Add your application to Bitrix24 for private usage or for publication in the catalog.
After adding you will receive a code and key of your application.
To receive "access_token" and authorize you application in requests to REST API Bitrix, clone "Bitrix OAuth" process template.
Description of incoming process parameters
- portal - your Bitrix24 portal that was specified with registration. For example, if the address of your Bitrix24 - https://corezoid.bitrix24.ru, then the name of the portal -
- client_id - application code
- client_secret - application key
- scope - available permissions for application (more than one, separate by commas). List of available SCOPE values.
- code - first authorization code
How to receive
"code" incoming parameter value
In browser address line, paste the link:
- Your Bitrix24 portal, - application code
Browser redirects you to the application's URL and transfers authorization's code - code.
As a result, in address bar you will see next link:
Attention! Lifetime of "code" received parameter - 30 sec!
1) Go to
dashboard mode and press
Add task button - add request.
In appeared window, specify the required parameters:
and uncheck the box next to the
"Autogenerate reference" field in order to specify task reference name = token.
2) Go to browser and get the "code" parameter from link below
3) Specify the value of obtained parameter in added task
4) After all parameters are specified, press
It is enough to create a request only once.
In case of success, received token will be kept in
"access_token" request parameter.
You can receive its value in other processes by using contruction:
In "Bitrix OAuth" process
"access_token" will be renewed every 25 mins.
If "access_token" is not renewed
In case if you will get an error when token is renewed, task will go to
"access_token" doesn't update. Escalation to the process author" node.
In this node you are able to customize the escalation using PRC logic and call the process of sending notification about error to the process author: