Event of Queue Change onOfflineEvent
Who can subscribe: any user
The onOfflineEvent notifies about the occurrence of new offline events at certain intervals.
The application can subscribe to two types of events.
- Regular: the event triggers an external URL and performs an action defined by that address.
- Offline: instead of calling an external URL, events are locally saved on the account, from where they can later be retrieved using the methods event.offline.*.
For the onOfflineEvent, the necessity of sending a notification is determined based on the local saving, and then it is sent as a regular event to the external URL.
Events will not be sent to the application until the installation is complete. Check the application installation
What the Handler Receives
Data is transmitted as a POST request
{
"event": "ONOFFLINEEVENT",
"data": {
"type": "add",
"event": "onTaskAdd",
"handler": "https://example.com/handler.php",
"minTimeout": 5
},
"ts": "1466439714",
"auth": {
"access_token": "s6p6eclrvim6da22ft9ch94ekreb52lv",
"expires_in": "3600",
"scope": "task",
"domain": "some-domain.bitrix24.com",
"server_endpoint": "https://oauth.bitrix.info/rest/",
"status": "F",
"client_endpoint": "https://some-domain.bitrix24.com/rest/",
"member_id": "a223c6b3710f85df22e9377d6c4f7553",
"refresh_token": "4s386p3q0tr8dy89xvmt96234v3dljg8",
"application_token": "51856fefc120afa4b628cc82d3935cce"
}
}
Request Parameters
Required parameters are marked with *
|
Name |
Description |
|
event* |
Symbolic code of the event — |
|
data* |
Data about the event in the queue. The structure is described below |
|
ts* |
Date and time of the event sending |
|
auth* |
Authorization and account data. The structure is described below |
Parameter data
Required parameters are marked with *
|
Name |
Description |
|
type* |
Type of change: |
|
event* |
Name of the event. For example, |
|
handler* |
URL of the event handler |
|
minTimeout |
Minimum delay before sending the event in seconds. Used for event grouping. Default is 1 sec. If the parameter value:
The |
Parameter auth
Required parameters are marked with *
|
Name |
Description |
|
access_token* |
Token for accessing the API |
|
expires_in* |
Time in seconds until the token expires |
|
scope* |
Scope within which the event occurred |
|
domain* |
Address of Bitrix24 where the event occurred |
|
server_endpoint* |
Address of the Bitrix24 authorization server needed for refreshing OAuth 2.0 tokens |
|
status* |
Status of the application that subscribed to this event:
|
|
client_endpoint* |
General path for API method calls for Bitrix24 where the event occurred |
|
member_id* |
Identifier of Bitrix24 where the event occurred |
|
refresh_token* |
Token for extending authorization OAuth 2.0 |
|
application_token* |
Token for secure event processing |
offline_event — the application is not always able to receive events. It may be hidden behind firewalls, reside in an internal network, and so on. In this case, the offline event mechanism is used, where the application subscribes to events but does not specify a handler URL.
Continue Learning
- Get a list of available events
- Register a new event handler event.bind
- Get a List of Registered Event Handlers event.get
- Unbind Registered Event Handler event.unbind
- Security in Handlers
- Features, Advantages, and Disadvantages of Offline Events
- Get a list of offline events event.offline.list
- Get a List of Offline Events with `event.offline.get`
- Clear records in the offline event queue event.offline.clear
- Register Errors for Processing Offline Events event.offline.error