Click Reaction
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
ActionDto is the reaction to a click on an element of a timeline record. There are three types of actions, and each is described by its own set of fields:
|
|
What Happens on Click |
When to Use |
|
A link opens: a Bitrix24 object slider, a page, or an external site |
You need to take the user to a deal, a lead, or an external service |
|
|
The application receives the |
The click must run logic on the application side |
|
|
The slider of the application that set the action opens |
You need the application's own interface on top of the timeline |
The action is set in the following fields:
titleActionof the heading — optionalactionof a tag — optionalactionof the logo in the content area — optionalactionof alinkblock in content blocks — requiredactionof a button in the bottom part — requiredactionof a menu item — required
The type field is required. A value outside the list is rejected by the method with the ENUM_FIELD error, and a field that belongs to none of the three sets — with the FIELD_IS_REDUNDANT error. Bitrix24 does not reject fields of a different action type, but does not use them either.
Link Navigation redirect
A relative link to a standard Bitrix24 object that supports a slider opens the slider. Other relative links open as a regular redirect. A link specifying a domain is considered external and opens in a new browser tab.
Parameters
Required parameters are marked with *
|
Field |
Description |
|
type* |
Value |
|
uri* |
Valid link URI, for example |
Example
{
"type": "redirect",
"uri": "/crm/deal/details/1/"
}
Event restEvent
To receive the onCrmTimelineItemAction event, the application subscribes to it with the event.bind method or declares a handler during installation.
The event is received only by the application that set the action: for a configurable activity — the application that created the activity, for additional content blocks — the application that installed the blocks. Other applications do not receive the event.
The context is always passed to the handler:
|
Field |
Description |
|
id |
Event identifier — the value of the |
|
entityTypeId |
Identifier of the CRM object type the activity is linked to |
|
entityId |
Identifier of the element of this object |
|
activityId |
Identifier of the activity |
The values from actionParams are passed through the user's browser, so secrets and tokens must not be put there.
The user who clicked is identified by the standard auth[user_id] field of the event — it does not get into the action context.
Parameters
Required parameters are marked with *
|
Field |
Description |
|
type* |
Value |
|
id* |
Event identifier. Any value can be specified, for example |
|
actionParams |
Application data that reaches the event handler: the key is the parameter name, the value is a scalar. No more than 20 values, all of them are cast to strings |
|
animationType |
Animation shown while the event is being processed: |
The event handler often changes the record itself: it adds blocks or replaces the set of buttons. While the event is being processed, animationType shows the user that the click has been accepted:
|
Value |
What Is Blocked |
|
|
The entire timeline record, with a loader on top of it |
|
|
Only the button that was clicked |
The block is not released automatically: it persists until the application updates the activity with the crm.activity.configurable.update method.
Example
{
"type": "restEvent",
"id": "resetButtonClick",
"actionParams": {
"myId": 123,
"someImportant": "qwerty"
},
"animationType": "disable"
}
Such an action is assigned to a button or a menu item. Besides the context fields, the handler receives myId and someImportant set by the application.
Opening the Application Slider openRestApp
Warning
The action is not supported in the mobile application. If the scenario must work on mobile devices, choose redirect or restEvent.
The slider opens on top of the timeline, and the application interface runs inside it. The context is passed to the slider:
|
Field |
Description |
|
entityTypeId |
Identifier of the CRM object type the activity is linked to |
|
entityId |
Identifier of the element of this object |
|
activityId |
Identifier of the activity |
Parameters
Required parameters are marked with *
|
Field |
Description |
|
type* |
Value |
|
actionParams |
Application data that reaches the slider together with the context: the key is the parameter name, the value is a scalar. No more than 20 values, all of them are cast to strings |
|
sliderParams |
Options with which the slider is opened |
Example
{
"type": "openRestApp",
"actionParams": {
"myId": 123,
"someImportant": "qwerty"
},
"sliderParams": {
"title": "This is the application slider header",
"width": 700
}
}
ActionSliderParamsDtoObject
The object sets the slider size, the browser window title, and the label in the header. All of its fields are optional: without sliderParams the slider opens with the default settings.
Parameters of the ActionSliderParamsDto Object
|
Field |
Description |
Additional |
|
width |
Slider width, |
Set either |
|
leftBoundary |
Full-width slider for the browser window with a left margin, |
Set either |
|
title |
Browser window title text when opening the slider |
|
|
labelText |
Label text in the slider header |
For example, |
|
labelBgColor |
Label background color |
Allowed values: |
|
labelColor |
Label text color |
A six-digit HEX code with a hash, for example |