placement.bind
This method installs the embedding location handler.
The handler is limited by the following conditions:
- request is executed under administrator authorization,
- handler is located at the same domain, as the registered redirect_uri of the application
- . To install the embedding location handler in the CRM interface, provide access to the CRM.
- each embedding location is associated with the access permission (scope). To set the embedding location in the CRM UI you need to grant corresponding permissions to CRM.
After installing applications with UI, you need to execute the method BX24.installFinish after query. Otherwise buttons won't be displayed in embedding locations. Placements are displayed immediately for GUI-less server local applications.
Starting from rest 21.200.0 method supports multiple languages.
Parameters
Parameter | Description |
---|---|
PLACEMENT | Required embedding location ID. Required. |
HANDLER | URL for embedding location handler. Required. |
LANG_ALL | Array with parameters for each language. Array keys:
|
USER_ID | Receives an integer and allows to show the embedding for specified user (one user only!). With ''0'' or without this field - embedding is registered for all users.
Attention! This field is not supported by all
embedding locations
Presently, this field is supported by PAGE_BACKGROUND_WORKER.
. Upon attempting to register an embedding location without this feature enabled, you'll get an error |
Example
https://portal.bitrix24.com/rest/placement.bind/?auth=sode3flffcmv500fuagrprhllx3soi72 &PLACEMENT=CRM_CONTACT_LIST_MENU &HANDLER=http%3A%2F%2Fwww.applicationhost.com%2Fplacement%2F &TITLE=Demo HTTP/1.1 200 OK { "result": true }
Example with several languages supported:
CRest::call( 'placement.bind', [ 'PLACEMENT' => 'PLACEMENT_CODE', 'HANDLER' => 'https://example.com/place.php', 'LANG_ALL' => [ 'en' => [ 'TITLE' => 'title', 'DESCRIPTION' => 'description', 'GROUP_NAME' => 'group', ], 'de' => [ 'TITLE' => 'title', 'DESCRIPTION' => 'description', 'GROUP_NAME' => 'group', ], ], ] );