Call the Registered Interface Command BX24.placement.call
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
Scope:
placementWho can execute the method: any user
The method BX24.placement.call invokes an interface command registered by the current placement.
BX24.placement.call(command, parameters[, callback]);
Parameters
Required parameters are marked with *
|
Name |
Description |
|
command* |
The name of the command to invoke |
|
parameters |
Passed parameters. The value type depends on the command: object, string, number, array, or |
|
callback |
Callback function. It receives the result of the command |
For example, the command setValue of the USERFIELD_TYPE placement accepts the new field value as its second argument:
BX24.placement.call('setValue', value, () => {});
Available Commands
The set of commands is defined by the placement where the widget is open. There is no single list covering all placements: check it with BX24.placement.getInterface.
In the b24jssdk library, the second argument is optional: omit it for commands without parameters.
|
Placement |
Commands |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Besides the commands of the placement, general methods are available to the widget — for example BX24.resizeWindow. They are not returned in the list from BX24.placement.getInterface.
Code Examples
How to Use Examples in Documentation
BX24.ready(function () {
BX24.init(function () {
BX24.placement.call('getStatus', {}, function (result) {
console.log(result);
});
BX24.placement.call('CallCardSetCardTitle', {title: 'hello world!'}, function (result) {
console.log(result);
});
});
});
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide)
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
const result = await $b24.placement.call('getStatus')
console.log(result)
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', async () => {
const $b24 = await B24Js.initializeB24Frame()
const result = await $b24.placement.call('getStatus')
console.log(result)
})
</script>
Result
The content of the result is defined by the command itself and described on the command page. Commands that return nothing pass an empty array to the callback function, while read commands pass an object or an array with data.
A command returns its error to the same place — the JS interface has no separate error channel. For example, when there is no call card, the call card commands pass an array with an object:
[
{
"result": "error",
"errorCode": "Call card is undefined"
}
]
Errors
A placement silently ignores an unknown command: the callback function is not invoked and no error arrives. A call made from a placement where the command does not exist behaves the same way.
Check two conditions:
- the widget is open in the placement where the command is registered. The current placement is returned by BX24.placement.info
- the command name is passed without typos and with the correct capitalization. The list of available commands is returned by BX24.placement.getInterface