- Home
- CRM/ERP Integration
- Bitrix OAuth
Bitrix
Bitrix24 is a social network service for convenient operations, where all the necessary business tools are available:
task management, calendars, reports, file sharing and joint editing of documents through Bitrix24.Disk, CRM, workgroups etc.
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, click Use this process and template of process "Bitrix OAuth" will copy to your environment.
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 -
corezoid
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:
https://{{portal_name}}.bitrix24.ru/oauth/authorize/?response_type=code&client_id={{application_key}}
where,
{{portal_name}} - Your Bitrix24 portal,
{{application_code}} - application code
For example,
https://corezoid.bitrix24.ru/oauth/authorize/?response_type=code&client_id=local.55d32b338a90f0.23817
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:
code=6dm7bdbh6akpc9tax2lp3fih05m5gtf2
Attention! Lifetime of "code" received parameter - 30 sec!
Process launch
1) Go to dashboard
mode and press Add task
button - add request.
In appeared window, specify the required parameters:
- portal
- client_id
- client_secret
- scope
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 Send task
.
It is enough to create a request only once.
Process result
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:
{{conv[cloned_process_ID].ref[token].access_token}}
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:
SMS through Twilio, MessageBird
Email through Mandrill, UniSender
Message to Telegram