Get a List of Offline Events with event.offline.get
Who can execute the method: any user
The method event.offline.get returns the first queued offline events to the application according to the filter settings. The availability of offline events can be checked using the feature.get method.
This method works only in the context of application authorization.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
|
filter |
Record filter. By default, all records are returned without filtering. Filtering is supported by fields: Important: the operation type is placed before the field name in the filter |
|
|
order |
Record sorting. Sorting is supported by the same fields as in the filter, and an array of the form `[field=>ASC |
DESC]` is accepted. By default — [TIMESTAMP_X:ASC] |
|
limit |
Number of records to select. Default is 50 |
Additional Parameters
|
Name |
Description |
|
|
clear |
Values: `0 |
1 |
|
process_id |
Process identifier. Used if you need to re-select any unprocessed records from the current process |
|
|
auth_connector |
Source key. Used if the |
|
|
error |
Values: `0 |
1 |
Note
The method supports multithreaded parsing. This means that multiple parallel requests to /rest/event.offline.get are allowed (subject to limits on the number of requests per unit of time), and each will receive different sets of records.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"filter":{"=MESSAGE_ID":1,"=EVENT_NAME":"ONCRMLEADADD",">=ID":1},"auth_connector":"BxTest","auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/event.offline.get
try
{
const response = await $b24.callMethod(
'event.offline.get',
{
filter: {
'=MESSAGE_ID': 1,
'=EVENT_NAME': 'ONCRMLEADADD',
'>=ID': 1
},
auth_connector: 'BxTest'
}
);
const result = response.getData().result;
console.log('Result:', result);
processResult(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'event.offline.get',
[
'filter' => [
'=MESSAGE_ID' => 1,
'=EVENT_NAME' => 'ONCRMLEADADD',
'>=ID' => 1
],
'auth_connector' => 'BxTest'
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error: ' . $e->getMessage();
}
BX24.callMethod(
"event.offline.get",
{
"filter": {
"=MESSAGE_ID": 1,
"=EVENT_NAME": "ONCRMLEADADD",
">=ID": 1
},
"auth_connector": "BxTest"
},
function(result)
{
if(result.error())
console.error(result.error());
else
console.dir(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'event.offline.get',
[
'filter' => [
'=MESSAGE_ID' => 1,
'=EVENT_NAME' => 'ONCRMLEADADD',
'>=ID' => 1
],
'auth_connector' => 'BxTest'
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": {
"process_id": null,
"events": [
{
"ID": "1",
"TIMESTAMP_X": "2024-07-18T12:32:31+02:00",
"EVENT_NAME": "ONCRMLEADADD",
"EVENT_DATA": false,
"EVENT_ADDITIONAL": false,
"MESSAGE_ID": "1"
}
]
},
"time": {
"start": 1721299720.388504,
"finish": 1721299720.509809,
"duration": 0.12130498886108398,
"processing": 0.008239030838012695,
"date_start": "2024-07-18T12:48:40+02:00",
"date_finish": "2024-07-18T12:48:40+02:00",
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Root element of the response |
|
time |
Information about the execution time of the request |
Error Handling
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
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
- Clear records in the offline event queue event.offline.clear
- Register Errors for Processing Offline Events event.offline.error
- Event of Queue Change onOfflineEvent