### Check App Installation Status with app.info (async/await) Source: https://apidocs.bitrix24.ru/settings/app-installation/installation-finish.html Use the `app.info` method to check if an application is installed. This example uses async/await for modern JavaScript. It logs the installation status to the console. ```javascript try { const response = await $b24.callMethod('app.info', {}); console.log(response.getData().result.INSTALLED); // true или false } catch(error) { console.error(error); } ``` -------------------------------- ### Check App Installation Status with app.info (Callback) Source: https://apidocs.bitrix24.ru/settings/app-installation/installation-finish.html Use the `app.info` method to check if an application is installed. This example uses a callback function for asynchronous operations. It logs the installation status to the console. ```javascript BX24.callMethod( "app.info", {}, function(result) { if(result.error()) console.error(result.error()); else console.log(result.data().INSTALLED); // true или false } ); ``` -------------------------------- ### Get Disk Storage List using JS (callMethod with start) Source: https://apidocs.bitrix24.ru/api-reference/disk/storage/disk-storage-get-list.html This JavaScript example demonstrates manual pagination control for disk storage lists using `$b24.callMethod` and the `start` parameter. It offers precise control but is less efficient for large datasets than `fetchListMethod`. ```javascript // callMethod: Ручное управление постраничной навигацией через параметр start. // Используйте для точного контроля над пакетами запросов. // Для больших данных менее эффективен, чем fetchListMethod. try { const response = await $b24.callMethod('disk.storage.getlist', { filter: { NAME: '%Битрикс24%', }, order: { NAME: 'DESC' } }, 0); const result = response.getData().result || []; for (const entity of result) { console.log('Entity:', entity) } } catch (error) { console.error('Request failed', error) } ``` -------------------------------- ### Start Workflow with JavaScript (BX24.callMethod) Source: https://apidocs.bitrix24.ru/api-reference/bizproc/bizproc-workflow-start.html This JavaScript example shows how to start a workflow using BX24.callMethod with a callback function for handling the response. ```javascript BX24.callMethod( 'bizproc.workflow.start', { TEMPLATE_ID: 1, DOCUMENT_ID: [ 'crm', 'CCrmDocumentLead', 'LEAD_1' ], PARAMETERS: { 'Parameter1': 'user_1' }, }, function(result) { console.log('response', result.answer); if(result.error()) alert("Error: " + result.error()); else console.log(result.data()); } ); ``` -------------------------------- ### PHP SDK Example Source: https://apidocs.bitrix24.ru/api-reference/tasks/tasks-task-list.html This example demonstrates how to use the CRest::call method in PHP to get a list of tasks. ```APIDOC ## tasks.task.list ### Description Retrieves a list of tasks with specified sorting, filtering, and selected fields. ### Method POST ### Endpoint /rest//tasks.task.list ### Parameters #### Request Body - **order** (object) - Specifies the sorting order for tasks. Example: `{'DEADLINE': 'asc', 'PRIORITY': 'desc'}` - **filter** (object) - Specifies the filtering criteria for tasks. Example: `{'!STATUS': 6, '>= DEADLINE': '2023-10-27', 'RESPONSIBLE_ID': 547, '::SUBFILTER-PARAMS': {'FAVORITE': 'Y'}}` - **select** (array) - An array of fields to include in the response. Example: `['ID', 'TITLE', 'DESCRIPTION', 'STATUS', 'subStatus', 'DEADLINE', 'CREATED_DATE', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS', 'TAGS', 'COUNTERS', 'PRIORITY', 'MARK']` - **params** (object) - Additional parameters for the method. Example: `{'WITH_TIMER_INFO': true, 'WITH_RESULT_INFO': true, 'WITH_PARSED_DESCRIPTION': true}` ### Request Example ```php require_once('crest.php'); $result = CRest::call( 'tasks.task.list', [ 'order' => [ 'DEADLINE' => 'asc', 'PRIORITY' => 'desc' ], 'filter' => [ '!STATUS' => 6, '>=DEADLINE' => date('Y-m-d'), 'RESPONSIBLE_ID' => 547, '::SUBFILTER-PARAMS' => ['FAVORITE' => 'Y'] ], 'select' => [ 'ID', 'TITLE', 'DESCRIPTION', 'STATUS', 'subStatus', 'DEADLINE', 'CREATED_DATE', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS', 'TAGS', 'COUNTERS', 'PRIORITY', 'MARK' ], 'params' => [ 'WITH_TIMER_INFO' => true, 'WITH_RESULT_INFO' => true, 'WITH_PARSED_DESCRIPTION' => true, ], ] ); echo '
';
print_r($result);
echo '
'; ``` ### Response #### Success Response (200) - **result** (object) - Contains the list of tasks and their details. #### Response Example ```json { "result": { "tasks": [ { "id": "1", "title": "Task Title", "description": "Task Description", "status": "1", "subStatus": "1", "deadline": "2023-10-27T00:00:00+03:00", "createdDate": "2023-10-26T10:00:00+03:00", "responsibleId": "547", "accomplices": [], "auditors": [], "tags": [], "counters": { "commentsOld": "0", "commentsNew": "0", "filesOld": "0", "filesNew": "0", "வுகளில்": "0", "வுகளில்New": "0" }, "priority": "1", "mark": "" } ] } } ``` ``` -------------------------------- ### Using installFinish with BX24.js (Vue.js Example) Source: https://apidocs.bitrix24.ru/settings/app-installation/installation-finish.html This example demonstrates how to use `$b24.installFinish()` within a Vue.js application after performing necessary setup steps like registering placements and binding events. ```APIDOC ## Using installFinish with BX24.js ### Description This code snippet shows how to complete the application installation process using the `$b24.installFinish()` method after registering integrations and subscribing to events. ### Method `$b24.installFinish()` ### Usage Example (Vue.js) ```javascript ``` ``` -------------------------------- ### Start Watching a Task using BX24.js Source: https://apidocs.bitrix24.ru/api-reference/tasks/tasks-task-start-watch.html This example shows how to use BX24.callMethod to start watching a task. The callback function logs the result data. ```javascript BX24.callMethod( 'tasks.task.startwatch', { 'taskId': 8017 }, function(result){ console.info(result.data()); console.log(result); } ); ``` -------------------------------- ### Start Autodial with Sound (PHP - CRest) Source: https://apidocs.bitrix24.ru/api-reference/telephony/voximplant/voximplant-infocall-start-with-sound.html This PHP example uses the CRest library to start an autodial with sound playback. It includes basic error handling and logs any exceptions. ```php try { $response = $b24Service ->core ->call( 'voximplant.infocall.startwithsound', [ 'FROM_LINE' => 'reg151083', 'TO_NUMBER' => '79991234567', 'URL' => 'https://example.com/sound/notice.mp3', ] ); $result = $response ->getResponseData() ->getResult(); echo 'Success: ' . print_r($result, true); } catch (Throwable $e) { error_log($e->getMessage()); echo 'Error: ' . $e->getMessage(); } ``` -------------------------------- ### Getting Started with User Field Configuration Source: https://apidocs.bitrix24.ru/api-reference/crm/universal/userfieldconfig/index.html A step-by-step guide to initializing and managing user fields using the userfieldconfig methods. ```APIDOC ## How to Get Started 1. Determine the `moduleId` and the `entityId` format for your target object. 2. Retrieve available field types using `userfieldconfig.getTypes`. 3. Create a new field with the `userfieldconfig.add` method. 4. Fetch a list of user field settings using `userfieldconfig.list` or the settings for a specific field via `userfieldconfig.get`. 5. If necessary, modify or delete the field using the `userfieldconfig.update` and `userfieldconfig.delete` methods. ``` -------------------------------- ### Using installFinish with BX24.js (Legacy Example) Source: https://apidocs.bitrix24.ru/settings/app-installation/installation-finish.html This example shows the traditional way to call `BX24.installFinish()` after setting up integrations and event handlers, typically used in older JavaScript environments. ```APIDOC ## Using installFinish with BX24.js (Legacy) ### Description This snippet demonstrates the usage of `BX24.installFinish()` in a legacy JavaScript context, ensuring the installation is marked as complete after necessary configurations. ### Method `BX24.installFinish()` ### Usage Example ```javascript BX24.init(function() { // 1. Registering a placement in the deal card BX24.callMethod('placement.bind', { PLACEMENT: 'CRM_DEAL_DETAIL_TAB', HANDLER: 'https://example.com/deal-tab', TITLE: 'Application Data' }); // 2. Subscribing to the deal creation event BX24.callMethod('event.bind', { event: 'ONCRMDEALADD', handler: 'https://example.com/event-handler' }); // 3. Finishing the installation BX24.installFinish(); }); ``` ``` -------------------------------- ### Getting Started with the Catalog API Source: https://apidocs.bitrix24.ru/api-reference/catalog/index.html This guide outlines the steps to begin interacting with the Catalog API, including checking data structures, identifying core objects, and performing basic operations like listing, adding, updating, and retrieving data. ```APIDOC ## Getting Started 1. **Check Data Structure:** Verify the structure of your desired object, field names, and their types on the "Data Types and Object Structure in REST API Catalog" page. 2. **Identify Core Object:** Determine the primary object for your scenario: product, price, property, warehouse, or accounting document. 3. **List Objects:** Open the relevant section and use the `list` method to retrieve a list of objects and their working identifiers. 4. **Add or Update Objects:** Perform changes to an object using the `add` or `update` methods for the corresponding section. 5. **Verify Results:** Check the outcome using the `get` method and, if necessary, refine available fields with the `getFields` method. ``` -------------------------------- ### Get CRM Items List (JavaScript SDK - callMethod) Source: https://apidocs.bitrix24.ru/api-reference/crm/universal/crm-item-list.html This example shows how to manually control pagination using the `start` parameter with the Bitrix24 JavaScript SDK's `callMethod`. This method offers precise control over request batches but is less efficient than `fetchListMethod` for large datasets. ```APIDOC ## GET crm.item.list (JavaScript SDK - callMethod) ### Description Manually controls pagination using the `start` parameter with the `callMethod`. Offers precise control over request batches but is less efficient than `fetchListMethod` for large datasets. Includes specific filters and sorting. ### Method JavaScript SDK method: `$b24.callMethod` ### Parameters - **methodName** (string) - 'crm.item.list' - **params** (object) - Request parameters including `entityTypeId`, `select`, `filter`, `order`, and `start` for pagination. - `entityTypeId`: 1 - `select`: ["id", "title", "lastName", "name", "stageId", "sourceId", "assignedById", "opportunity", "isManualOpportunity"] - `filter`: { "0": {"logic": "OR", "0": {"!=name": ""}, "1": {"!=lastName": ""}}, "@stageId": ["NEW", "IN_PROCESS"], "@sourceId": ["WEB", "ADVERTISING"], "@assignedById": [1, 6], "">=opportunity": 5000, "<=opportunity": 20000, "isManualOpportunity": "Y" } - `order`: {"lastName": "ASC", "name": "ASC"} - `start` (integer) - The starting point for fetching records (for manual pagination). ### Request Example ```javascript try { const response = await $b24.callMethod('crm.item.list', { entityTypeId: 1, select: [ "id", "title", "lastName", "name", "stageId", "sourceId", "assignedById", "opportunity", "isManualOpportunity", ], filter: { "0": { logic: "OR", "0": { "!=name": "", }, "1": { "!=lastName": "", }, }, "@stageId": ["NEW", "IN_PROCESS"], "@sourceId": ['WEB', "ADVERTISING"], "@assignedById": [1, 6], ">=opportunity": 5000, "<=opportunity": 20000, "isManualOpportunity": "Y", }, order: { lastName: 'ASC', name: 'ASC', }, start: 0 // Example: starting from the first record }); // Process the response } catch (error) { console.error('Request failed', error); } ``` ### Response (Response structure not detailed in source) ``` -------------------------------- ### Example Registration with OPTIONS Source: https://apidocs.bitrix24.ru/api-reference/widgets/crm/detail-activity-area.html This example demonstrates how to use the placement.bind method to register a new CRM integration, including the OPTIONS parameter to configure the interface and user notifications. ```APIDOC ## Пример регистрации ```javascript BX24.callMethod( 'placement.bind', { 'PLACEMENT': 'CRM_DEAL_DETAIL_ACTIVITY', 'HANDLER': 'https://your-handler-uri.ru', 'TITLE': 'Моя встройка', 'OPTIONS': { 'useBuiltInInterface': 'Y', 'newUserNotificationTitle': 'Встречайте новое приложение', 'newUserNotificationText': 'E-invoice поможет работать со счетами' } } ); ``` ``` -------------------------------- ### Start a Callback Source: https://apidocs.bitrix24.ru/api-reference/telephony/voximplant/index.html Use this method to initiate a callback. Ensure you have the necessary user and configuration IDs. ```javascript voximplant.callback.start({ "user_id": 1, "phone_number": "+79001234567" }); ``` -------------------------------- ### JavaScript Examples Source: https://apidocs.bitrix24.ru/api-reference/vibe/landing-repowidget-get-list.html Demonstrates how to call landing.repowidget.getlist using BX24.js with different methods for handling data retrieval. ```APIDOC ## callListMethod (JS) ### Description Gets all data at once. Use only for small selections (< 1000 elements) due to high memory load. ### Method `$b24.callListMethod` ### Endpoint `landing.repowidget.getlist` ### Parameters #### Request Body - **params** (object) - Required - Parameters for the method call, including select and filter. - **select** (array) - Required - Fields to retrieve. - **filter** (object) - Optional - Filtering criteria. ### Request Example ```javascript try { const response = await $b24.callListMethod( 'landing.repowidget.getlist', { params: { select: [ 'ID', 'NAME' ], filter: { '>ID': '1' } } }, (progress) => { console.log('Progress:', progress) } ) const items = response.getData() || [] for (const entity of items) { console.log('Entity:', entity) } } catch (error) { console.error('Request failed', error) } ``` ## fetchListMethod (JS) ### Description Fetches data in parts using an iterator. Use for large amounts of data for efficient memory consumption. ### Method `$b24.fetchListMethod` ### Endpoint `landing.repowidget.getlist` ### Parameters #### Request Body - **params** (object) - Required - Parameters for the method call, including select and filter. - **select** (array) - Required - Fields to retrieve. - **filter** (object) - Optional - Filtering criteria. - **iteratorField** (string) - Required - The field to use for iteration. ### Request Example ```javascript try { const generator = $b24.fetchListMethod('landing.repowidget.getlist', { params: { select: [ 'ID', 'NAME' ], filter: { '>ID': '1' } } }, 'ID') for await (const page of generator) { for (const entity of page) { console.log('Entity:', entity) } } } catch (error) { console.error('Request failed', error) } ``` ## callMethod (JS) ### Description Manual pagination control via the start parameter. Use for precise control over request batches. Less efficient for large data than fetchListMethod. ### Method `$b24.callMethod` ### Endpoint `landing.repowidget.getlist` ### Parameters #### Request Body - **params** (object) - Required - Parameters for the method call, including select and filter. - **select** (array) - Required - Fields to retrieve. - **filter** (object) - Optional - Filtering criteria. - **start** (integer) - Required - The starting point for pagination. ### Request Example ```javascript try { const response = await $b24.callMethod('landing.repowidget.getlist', { params: { select: [ 'ID', 'NAME' ], filter: { '>ID': '1' } } }, 0) const result = response.getData().result || [] for (const entity of result) { console.log('Entity:', entity) } } catch (error) { console.error('Request failed', error) } ``` ``` -------------------------------- ### Get Landing Block Content using JavaScript (Promise-based) Source: https://apidocs.bitrix24.ru/api-reference/landing/block/methods/landing-block-get-content.html Example of how to get landing block content using JavaScript with promises. ```APIDOC ## await $b24.callMethod('landing.block.getcontent', params) ### Description Retrieves the content of a specific landing block using JavaScript with promises. ### Method `$b24.callMethod` (async function) ### Parameters - **method** (string) - Required - The method name: 'landing.block.getcontent'. - **params** (object) - Required - Parameters for the method. - **lid** (integer) - Required - The ID of the landing page. - **block** (integer) - Required - The ID of the block. - **editMode** (boolean) - Required - Specifies if the content should be retrieved in edit mode. - **params** (object) - Optional - Additional parameters. - **wrapper_show** (boolean) - Optional - Whether to show the wrapper. ### Request Example ```javascript try { const response = await $b24.callMethod( 'landing.block.getcontent', { lid: 4858, block: 39556, editMode: true, params: { wrapper_show: false } } ); const result = response.getData().result; console.info(result); } catch (error) { console.error(error); } ``` ### Response #### Success Response - **result** (object) - The content of the landing block. ``` -------------------------------- ### Start Callback using BX24.js Source: https://apidocs.bitrix24.ru/api-reference/telephony/voximplant/voximplant-callback-start.html Initiate a callback using the BX24.js library. This example demonstrates how to call the `voximplant.callback.start` method and handle the response or errors. ```javascript BX24.callMethod( 'voximplant.callback.start', { FROM_LINE: 'reg151083', TO_NUMBER: '79991234567', TEXT_TO_PRONOUNCE: 'Вам поступил запрос на обратный звонок', VOICE: 'ruinternalfemale' }, function(result) { if (result.error()) { console.error(result.error(), result.error_description()); } else { console.log(result.data()); } } ); ``` -------------------------------- ### Get Landing Block Content using JavaScript (BX24.js) Source: https://apidocs.bitrix24.ru/api-reference/landing/block/methods/landing-block-get-content.html Example of how to get landing block content using the BX24.js library. ```APIDOC ## BX24.callMethod('landing.block.getcontent', params, callback) ### Description Retrieves the content of a specific landing block using the BX24.js library. ### Method `BX24.callMethod` ### Parameters - **method** (string) - Required - The method name: 'landing.block.getcontent'. - **params** (object) - Required - Parameters for the method. - **lid** (integer) - Required - The ID of the landing page. - **block** (integer) - Required - The ID of the block. - **editMode** (boolean) - Required - Specifies if the content should be retrieved in edit mode. - **params** (object) - Optional - Additional parameters. - **wrapper_show** (boolean) - Optional - Whether to show the wrapper. - **callback** (function) - Required - A callback function to handle the response. ### Request Example ```javascript BX24.callMethod( 'landing.block.getcontent', { lid: 4858, block: 39556, editMode: true, params: { wrapper_show: false } }, function(result) { if (result.error()) { console.error(result.error()); } else { console.info(result.data()); } } ); ``` ### Response #### Success Response The callback function receives a result object. If successful, `result.data()` will contain the block content. ``` -------------------------------- ### Getting Started with UI Interaction Source: https://apidocs.bitrix24.ru/api-reference/widgets/ui-interaction/index.html Follow these steps to begin interacting with the Bitrix24 UI: open your application in a placement, get the call context, request available commands and events, subscribe to events, and call commands. Use additional BX24.js methods for opening standard Bitrix24 pages or dialogs. ```APIDOC ## How to Get Started 1. Open the application in the desired placement. 2. Get the call context using `BX24.placement.info`. 3. Request available commands and events using `BX24.placement.getInterface`. 4. Subscribe to events using `BX24.placement.bindEvent` and call commands using `BX24.placement.call`. 5. If you need to open a standard Bitrix24 page, an application slider, or a system dialog, use additional `BX24.js` methods and system dialogs. ``` -------------------------------- ### PHP Service Example Source: https://apidocs.bitrix24.ru/api-reference/vibe/landing-repowidget-get-list.html Demonstrates calling landing.repowidget.getlist using the PHP service layer, likely within a Bitrix24 environment. ```APIDOC ## $b24Service->core->call (PHP) ### Description Calls the landing.repowidget.getlist method through the PHP service layer. ### Method `$b24Service->core->call` ### Endpoint `landing.repowidget.getlist` ### Parameters #### Request Body - **method** (string) - Required - The method to call, e.g., 'landing.repowidget.getlist'. - **params** (array) - Required - Parameters for the method call. - **select** (array) - Required - Fields to retrieve. - **filter** (array) - Optional - Filtering criteria. ### Request Example ```php try { $response = $b24Service ->core ->call( 'landing.repowidget.getlist', [ 'params' => [ 'select' => [ 'ID', 'NAME' ], 'filter' => [ '>ID' => '1' ] ] ] ); $result = $response ->getResponseData() ->getResult(); if ($result->error()) { error_log($result->error()); } else { echo 'Success: ' . print_r($result->data(), true); } } catch (Throwable $e) { error_log($e->getMessage()); echo 'Error getting repowidget list: ' . $e->getMessage(); } ``` ``` -------------------------------- ### Error Response Example Source: https://apidocs.bitrix24.ru/api-reference/timeman/timecontrol/timeman-timecontrol-settings-get.html This is an example of an error response when attempting to access the Time Control Settings Get method without proper authorization. ```json { "error": "ACCESS_ERROR", "error_description": "You don't have access to use this method" } ``` -------------------------------- ### File Download URL Example Source: https://apidocs.bitrix24.ru/api-reference/chats/messages/im-dialog-messages-get.html This example shows a typical URL structure for downloading a file from a Bitrix24 instance. It includes parameters for site ID, file ID, and security tokens. ```json { "src": "https://mysite.ru/bitrix/services/main/ajax.php?action=disk.api.file.download&SITE_ID=s1&humanRE=1&fileId=5255&exact=N&_esd=s6P3x5qDBEKU0NiS7sczr69Y%2FHHR8Za8EXa7STOAXIVOylYhMsnMj5nGU0VXeQ1PIsqm%2F0GNxOju5wR1jNj76d%2FZnVgpyqeIcJ4UiWXm8CJsrmARXWpxWe%2BgJ%2BpGqx0M5CxgjNzIopQp2cwM&fileName=image.png", "viewerResized": "", "objectId": "5255", "viewerGroupBy": "1489", "imChatId": 1489, "title": "image.png", "actions": "[{\"type\":\"download\"},{\"type\":\"copyToMe\",\"text\":\"Сохранить на Диск\",\"action\":\"BXIM.disk.saveToDiskAction\",\"params\":{\"fileId\":\"5255\"},\"extension\":\"disk.viewer.actions\",\"buttonIconClass\":\"ui-btn-icon-cloud\"}]" } ``` -------------------------------- ### Get Landing Block Content using PHP (CRest) Source: https://apidocs.bitrix24.ru/api-reference/landing/block/methods/landing-block-get-content.html Example of how to get landing block content using the CRest library in PHP. ```APIDOC ## CRest::call('landing.block.getcontent', params) ### Description Retrieves the content of a specific landing block using the CRest library in PHP. ### Method `CRest::call` ### Parameters - **method** (string) - Required - The method name: 'landing.block.getcontent'. - **params** (array) - Required - Parameters for the method. - **lid** (integer) - Required - The ID of the landing page. - **block** (integer) - Required - The ID of the block. - **editMode** (boolean) - Required - Specifies if the content should be retrieved in edit mode. - **params** (array) - Optional - Additional parameters. - **wrapper_show** (boolean) - Optional - Whether to show the wrapper. ### Request Example ```php require_once('crest.php'); $result = CRest::call( 'landing.block.getcontent', [ 'lid' => 4858, 'block' => 39556, 'editMode' => true, 'params' => [ 'wrapper_show' => false, ], ] ); if (isset($result['error'])) { echo 'Ошибка: ' . $result['error_description']; } else { echo '
';
    print_r($result['result']);
    echo '
'; } ``` ### Response #### Success Response (200) - **result** (array) - The content of the landing block. - **time** (array) - Information about the request execution time. ``` -------------------------------- ### cURL (OAuth) Example for task.planner.getlist Source: https://apidocs.bitrix24.ru/api-reference/tasks/planner/task-planner-get-list.html This cURL example demonstrates how to call the task.planner.getlist method using an OAuth access token. Replace the placeholder with your actual access token. ```bash curl -X POST \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{"auth":"**put_access_token_here**"}' \ https://**put_your_bitrix24_address**/rest/task.planner.getlist ``` -------------------------------- ### Get Landing Block Content using cURL (Webhook) Source: https://apidocs.bitrix24.ru/api-reference/landing/block/methods/landing-block-get-content.html Example of how to get landing block content using a cURL request with a webhook. ```APIDOC ## POST /landing.block.getcontent.json ### Description Retrieves the content of a specific landing block using a webhook. ### Method POST ### Endpoint `https://**put.your-domain-here**/rest/**user_id**/**webhook_code**/landing.block.getcontent.json` ### Request Body - **lid** (integer) - Required - The ID of the landing page. - **block** (integer) - Required - The ID of the block. - **editMode** (boolean) - Required - Specifies if the content should be retrieved in edit mode. - **params** (object) - Optional - Additional parameters. - **wrapper_show** (boolean) - Optional - Whether to show the wrapper. ### Request Example ```json { "lid": 4858, "block": 39556, "editMode": true, "params": { "wrapper_show": false } } ``` ### Response #### Success Response (200) - **result** (object) - The content of the landing block. - **time** (object) - Information about the request execution time. ``` -------------------------------- ### Voximplant Callback and Infocall Operations Source: https://apidocs.bitrix24.ru/whats-new.html Documentation for voximplant.callback.start, voximplant.infocall.startwithsound, and voximplant.infocall.startwithtext has been updated. ```APIDOC ## voximplant.callback.start, voximplant.infocall.startwithsound, voximplant.infocall.startwithtext ### Description Updated documentation for initiating callbacks and infocalls with sound or text within the Voximplant module. ### Endpoint `/voximplant.*` ### Parameters (Specific parameters not detailed in the source text) ### Request Example (No example provided in the source text) ### Response (Specific response details not detailed in the source text) ``` -------------------------------- ### Start Voximplant Infocall using BX24.callMethod (Callback) Source: https://apidocs.bitrix24.ru/api-reference/telephony/voximplant/voximplant-infocall-start-with-text.html This example uses BX24.callMethod with a callback function to handle the response or errors when starting an automated call. ```javascript BX24.callMethod( 'voximplant.infocall.startwithtext', { FROM_LINE: 'reg151083', TO_NUMBER: '79991234567', TEXT_TO_PRONOUNCE: 'Добрый день. Напоминаем о записи' }, function(result) { if (result.error()) { console.error(result.error(), result.error_description()); } else { console.log(result.data()); } } ); ``` -------------------------------- ### Create Folder using BX24.js Source: https://apidocs.bitrix24.ru/api-reference/disk/storage/disk-storage-add-folder.html This example shows how to create a folder using the BX24.js library. It includes a callback function to handle the result or errors. ```javascript BX24.callMethod( "disk.storage.addfolder", { id: 1357, data: { NAME: 'Новая папка' }, rights: [ { TASK_ID: 71, ACCESS_CODE: 'U1271' } ] }, function (result) { if (result.error()) console.error(result.error()); else console.dir(result.data()); } ); ``` -------------------------------- ### Add Task with Deadline and Files Source: https://apidocs.bitrix24.ru/api-reference/tasks/tasks-task-add.html Example of creating a task with a deadline, assigning it to a user, and attaching files from Bitrix24 Disk. ```php use Bitrix\Main\Loader; use Bitrix\Tasks\TaskTable; Loader::includeModule('tasks'); $result = TaskTable::add( [ 'TITLE' => 'My new task', 'DESCRIPTION' => 'Task description', 'DEADLINE' => '2024-12-31', 'RESPONSIBLE_ID' => 1, 'GROUP_ID' => 1, 'UF_TASK_WEBDAV_FILES' => [ 'n12345', // Disk file ID 'n67890' // Disk file ID ] ] ); if (isset($result['error'])) { echo 'Error: ' . $result['error_description']; } else { echo 'Task successfully created with ID ' . $result['result']['task']['id']; } ``` -------------------------------- ### Initialization and First Launch Functions Source: https://apidocs.bitrix24.ru/sdk/bx24-js-sdk/system-functions/index.html Functions for initializing the Bitrix24 library, handling the first launch of an application, and completing the installation process. ```APIDOC ## BX24.init ### Description Adds a handler for the 'library is ready to work' event. ### Method BX24.init ### Parameters None ### Request Example ```javascript BX24.init(function(){ console.log('Bitrix24 library is ready!'); }); ``` ### Response None directly, but triggers the provided callback when the library is ready. ``` ```APIDOC ## BX24.install ### Description Registers a handler for the first launch of the application by the current user. ### Method BX24.install ### Parameters - **callback** (function) - Required - A function to be called when the application is launched for the first time by the user. ### Request Example ```javascript BX24.install(function(){ console.log('Application first launch handler executed.'); }); ``` ### Response None directly, but executes the callback on first launch. ``` ```APIDOC ## BX24.installFinish ### Description Completes the installer or application setup process. ### Method BX24.installFinish ### Parameters None ### Request Example ```javascript BX24.installFinish(); ``` ### Response None. ``` -------------------------------- ### Get Landing Block Content using PHP (Core Service) Source: https://apidocs.bitrix24.ru/api-reference/landing/block/methods/landing-block-get-content.html Example of how to get landing block content using the core service in PHP. ```APIDOC ## $b24Service->core->call('landing.block.getcontent', params) ### Description Retrieves the content of a specific landing block using the core service in PHP. ### Method `$b24Service->core->call` ### Parameters - **method** (string) - Required - The method name: 'landing.block.getcontent'. - **params** (array) - Required - Parameters for the method. - **lid** (integer) - Required - The ID of the landing page. - **block** (integer) - Required - The ID of the block. - **editMode** (boolean) - Required - Specifies if the content should be retrieved in edit mode. - **params** (array) - Optional - Additional parameters. - **wrapper_show** (boolean) - Optional - Whether to show the wrapper. ### Request Example ```php try { $response = $b24Service ->core ->call( 'landing.block.getcontent', [ 'lid' => 4858, 'block' => 39556, 'editMode' => true, 'params' => [ 'wrapper_show' => false, ], ] ); $result = $response ->getResponseData() ->getResult(); echo 'Success: ' . var_export($result, true); } catch (Throwable $e) { error_log($e->getMessage()); echo 'Error getting block content: ' . $e->getMessage(); } ``` ### Response #### Success Response - **result** (mixed) - The content of the landing block. - **time** (mixed) - Information about the request execution time. ``` -------------------------------- ### Get Landing Block Content using cURL (OAuth) Source: https://apidocs.bitrix24.ru/api-reference/landing/block/methods/landing-block-get-content.html Example of how to get landing block content using a cURL request with OAuth authentication. ```APIDOC ## POST /landing.block.getcontent.json ### Description Retrieves the content of a specific landing block using OAuth authentication. ### Method POST ### Endpoint `https://**put.your-domain-here**/rest/landing.block.getcontent.json` ### Parameters #### Request Body - **lid** (integer) - Required - The ID of the landing page. - **block** (integer) - Required - The ID of the block. - **editMode** (boolean) - Required - Specifies if the content should be retrieved in edit mode. - **params** (object) - Optional - Additional parameters. - **wrapper_show** (boolean) - Optional - Whether to show the wrapper. - **auth** (string) - Required - The access token for OAuth authentication. ### Request Example ```json { "lid": 4858, "block": 39556, "editMode": true, "params": { "wrapper_show": false }, "auth": "**put_access_token_here**" } ``` ### Response #### Success Response (200) - **result** (object) - The content of the landing block. - **time** (object) - Information about the request execution time. ``` -------------------------------- ### IM Dialog Get Response Source: https://apidocs.bitrix24.ru/api-reference/chats/im-dialog-get.html This is an example of a successful response from the IM Dialog Get API. It includes detailed chat information and request timing. ```json { "result": { "id": 1439, "parent_chat_id": 0, "parent_message_id": 0, "name": "Чат по сделке", "description": "Здесь обсуждаем сделку", "owner": 503, "extranet": false, "avatar": "", "color": "#f76187", "type": "crm", "counter": 0, "user_counter": 3, "message_count": 3, "unread_id": 0, "restrictions": { "avatar": false, "rename": false, "extend": true, "call": true, "mute": true, "leave": true, "leave_owner": false, "send": true, "user_list": true, "path": "", "path_title": "" }, "last_message_id": 84477, "last_id": 84477, "marked_id": 0, "disk_folder_id": 0, "entity_type": "CRM", "entity_id": "DEAL|1663", "entity_data_1": "", "entity_data_2": "", "entity_data_3": "", "mute_list": [], "date_create": "2026-02-25T16:50:58+03:00", "message_type": "C", "public": "", "role": "owner", "entity_link": { "type": "DEAL", "url": "/crm/deal/details/1663/", "id": "DEAL|1663" }, "text_field_enabled": true, "background_id": null, "permissions": { "manage_users_add": "member", "manage_users_delete": "manager", "manage_ui": "member", "manage_settings": "owner", "manage_messages": "member", "can_post": "member" }, "is_new": false, "readed_list": [ { "user_id": 103, "user_name": "Иван Иванов", "message_id": 0, "date": null }, { "user_id": 547, "user_name": "Петр Петров", "message_id": 0, "date": null } ], "manager_list": [ 503 ], "last_message_views": { "message_id": 84477, "first_viewers": [], "count_of_viewers": 0 }, "dialog_id": "chat1439" }, "time": { "start": 1772030091, "finish": 1772030091.165223, "duration": 0.1652228832244873, "processing": 0, "date_start": "2026-02-25T17:34:51+03:00", "date_finish": "2026-02-25T17:34:51+03:00", "operating_reset_at": 1772030691, "operating": 0 } } ``` -------------------------------- ### Getting Started with File Operations Source: https://apidocs.bitrix24.ru/api-reference/files/index.html Follow these steps to begin working with files in Bitrix24: determine the file field type, encode files to Base64 if necessary, URL-encode Base64 strings for GET requests, or upload to Disk and use the Disk object ID. ```APIDOC ## Getting Started with File Operations 1. Determine the field type: file or file (disk). 2. Encode the file to Base64 if you need to pass the file into a standard field. 3. URL-encode the Base64 string if the file is being passed via a GET request or cURL. 4. Upload the file to Disk and pass the `ID` of the Disk object if the field is linked to Disk. ``` -------------------------------- ### Successful Workflow Start Response Source: https://apidocs.bitrix24.ru/api-reference/bizproc/bizproc-workflow-start.html This is an example of a successful response when starting a business process workflow. It includes the workflow result ID and timing information. ```json { "result": "66e81a641752f8.56521481", "time": { "start": 1726476060.581428, "finish": 1726476060.813776, "duration": 0.23234796524047852, "processing": 0.002630949020385742, "date_start": "2024-09-16T08:41:00+00:00", "date_finish": "2024-09-16T08:41:00+00:00", "operating_reset_at": 1726476660, "operating": 0, } } ``` -------------------------------- ### Add Document using PHP CRest (Partial Example) Source: https://apidocs.bitrix24.ru/api-reference/document-generator/document-generator-document-add.html This is a partial PHP example using CRest to add a document, showing the initial setup and parameters. ```APIDOC ## Add Document using PHP CRest (Partial Example) ### Description This is a partial PHP example using CRest to add a document, showing the initial setup and parameters. ### Method `CRest::call` ### Parameters `documentgenerator.document.add` method with the following parameters: ```json [ 'templateId' => 53, 'value' => 'SUPPLY_CONTRACT_2026_015', 'values' => [ 'DocumentNumber' => 'ДГ-2026-001', 'CurrentDate' => '2026-03-18T00:00:00+03:00', 'ClientName' => 'ООО Ромашка', 'ClientPhone' => '+7 999 123-45-67', 'Total' => '125000', 'Comment' => 'Оплата в течение 5 рабочих дней после подписания', 'UserName' => 'Иван Петров', ], 'fields' => [ 'CurrentDate' => [ 'TYPE' => 'DATE', 'FORMAT' => [ 'format' => 'd.m.Y', ], 'TITLE' => 'Дата договора', ] ], 'stampsEnabled' => 1, ] ``` ### Code Example (Partial) ```php require_once('crest.php'); $result = CRest::call( 'documentgenerator.document.add', [ 'templateId' => 53, 'value' => 'SUPPLY_CONTRACT_2026_015', 'values' => [ 'DocumentNumber' => 'ДГ-2026-001', 'CurrentDate' => '2026-03-18T00:00:00+03:00', 'ClientName' => 'ООО Ромашка', 'ClientPhone' => '+7 999 123-45-67', 'Total' => '125000', 'Comment' => 'Оплата в течение 5 рабочих дней после подписания', 'UserName' => 'Иван Петров', ], 'fields' => [ 'CurrentDate' => [ 'TYPE' => 'DATE', 'FORMAT' => [ 'format' => 'd.m.Y', ], 'TITLE' => 'Дата договора', ] ], 'stampsEnabled' => 1, ] ); ``` ``` -------------------------------- ### Overview of Placement Methods Source: https://apidocs.bitrix24.ru/api-reference/widgets/ui-interaction/index.html This section provides an overview of the core methods available within the `placement` scope for interacting with the Bitrix24 UI. These methods allow you to get context information, manage interface commands, and handle events. ```APIDOC ## Overview of Methods > Scope: `placement` > Who can execute the method: any user **Method** | **Description** ---|--- `BX24.placement.info` | Gets information about the call context. `BX24.placement.getInterface` | Gets a list of available commands and events for the current placement. `BX24.placement.call` | Invokes a registered interface command. `BX24.placement.bindEvent` | Registers a handler for an interface event. ```