event.bind
Scope: catalog Permissions: all
Registers a new event handler.
The method can be called only by a user having administrative privileges.
The method can be called by both standard user and a user having administrative privileges. However, functionality for standard user without admin access permissions has specific limitations:
- offline events are unavailable, setup attempts will result in a thrown exception;
- events are set up on behalf of current user (see description for parameter auth_type); direct indication for auth_type, different from current user ID will also throw an exception;
Because the calls will be initiated from Bitrix servers, any URL should be accessible for external GET/POST requests.
This method uses the following interface: BX24.callBind.
When deleting and updating an application, its actions will be deleted as well. You'll have to re-set them in the installer for each version.
Parameters
Parameter | Description |
---|---|
event | Specifies the event name. This parameter is required. |
handler | Specifies the event handler. This parameter is required. |
auth_type | Specifies the ID of a user whose credentials will be used to install the handler. This parameter is optional. By default, the event handler will be authenticated as a user whose actions triggered the event. |
event_type | Values: online|offline. Default value is event_type=online and method operation does not change. When the value is event_type=offline, the method works with offline events. |
auth_connector | Source key. Parameter is intended for offline events. Allows preventing false event triggering. |
options | Extra settings for registered event, if available. |
Example
https://my.bitrix24.com/rest/event.bind.json?auth=a25e86871fcebb24f4d9076caf2e6623&auth_type=0&event=OnAppUpdate&handler=http%3A%2F%2Fwww.my-domain.com%2Fhandler%2F
Response
{"result":true}
© «Bitrix24», 2001-2024