Open Path in the BX24.openPath Slider
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
BX24.openPath(path: string, callback?: callable): void;
The BX24.openPath method opens a Bitrix24 page in a slider over the application, for example, a deal detail form or an employee profile. When the user closes the slider, they return to the application.
The method works only inside the application frame in Bitrix24. Call it after the library is initialized, in the BX24.init handler. The method requires no scope of its own: it controls the interface and does not call the REST API.
The method does not work on phones and tablets — neither in the mobile application nor in a mobile browser. The slider does not open, and callback receives the METHOD_NOT_SUPPORTED_ON_DEVICE error.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
path* |
The path to a page in the same Bitrix24 instance where the application is open. The path starts with The numbers in the path are identifiers of specific objects. Substitute your own values for them:
|
|
callback |
Callback function. It is called once: when the user closes the slider, when the path fails validation, or when the application is open on a phone (detailed description) |
To retrieve CRM object identifiers, use the list and creation methods, for example crm.item.list and crm.item.add. To retrieve an employee identifier, use user.get, and for a workgroup identifier use sonet_group.get.
Bitrix24 opens the page with additional parameters in the address: from=rest_placement&from_app=<application code>. The application code is its client_id, for example local.6ab58ce578dd87.16527213. As a result, the address of the opened page differs from the path you passed — keep this in mind if you compare addresses.
Code Example
How to Use Examples in Documentation
BX24.init(function () {
BX24.openPath('/crm/deal/details/5/', function (result) {
if (result.result === 'error') {
console.log('Failed to open the page:', result.errorCode);
return;
}
console.log('The user closed the slider');
});
});
Response Handling
The method does not return data (void). When the user closes the slider, Bitrix24 calls callback and passes an object:
{
"result": "close"
}
If the path fails validation or the application is open on a phone, callback is called immediately, without a slider:
{
"result": "error",
"errorCode": "PATH_NOT_AVAILABLE"
}
Returned Data
|
Name |
Description |
|
result |
Outcome: |
|
errorCode |
Error code. Present only when |
Error Handling
|
Code |
When It Occurs |
What to Do |
|
|
The path fails validation: it is empty, does not start with |
Pass a path relative to the Bitrix24 root, for example |
|
|
The application is open on a phone or tablet |
Show the user where to find the page, or suggest opening it on a computer |
The method does not check whether the page exists. If you pass a path to a nonexistent page, the slider opens anyway, and after it is closed, callback receives close.