Get User Availability from calendar.accessibility.get
Scope:
calendarWho can execute the method: any user
This method retrieves the availability of users from the list.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
users* |
Array of user IDs |
|
from* |
Start date of the period for determining availability in the format For example, |
|
to* |
End date of the period for determining availability in the format For example, |
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"from":"2024-06-20","to":"2024-12-20","users":[1,2,34]}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/calendar.accessibility.get
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"from":"2024-06-20","to":"2024-12-20","users":[1,2,34],"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/calendar.accessibility.get
try
{
const response = await $b24.callMethod(
'calendar.accessibility.get',
{
from: '2024-06-20',
to: '2024-12-20',
users: [1, 2, 34]
}
);
const result = response.getData().result;
// Your logic for processing data
processResult(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'calendar.accessibility.get',
[
'from' => '2024-06-20',
'to' => '2024-12-20',
'users' => [1, 2, 34]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
// Your logic for processing data
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting calendar accessibility: ' . $e->getMessage();
}
BX24.callMethod(
'calendar.accessibility.get',
{
from: '2024-06-20',
to: '2024-12-20',
users: [1, 2, 34]
}
);
require_once('crest.php');
$result = CRest::call(
'calendar.accessibility.get',
[
'from' => '2024-06-20',
'to' => '2024-12-20',
'users' => [1, 2, 34]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": {
"1": [
{
"ID": "1213",
"NAME": "Event name",
"DATE_FROM": "02.12.2024 11:00:00",
"DATE_TO": "02.12.2024 12:00:00",
"DATE_FROM_TS_UTC": "1733158800",
"DATE_TO_TS_UTC": "1733162400",
"~USER_OFFSET_FROM": -21600,
"~USER_OFFSET_TO": -21600,
"DT_SKIP_TIME": "N",
"TZ_FROM": "America/Managua",
"TZ_TO": "America/Managua",
"ACCESSIBILITY": "busy",
"IMPORTANCE": "normal",
"EVENT_TYPE": "#collab#"
},
{
"ID": "1216",
...
}
],
"2": [
{
"ID": 1,
...
},
{
"ID": 2,
...
}
],
"34": []
}
}
Returned Data
|
Name |
Description |
|
result |
The result contains an object. The key of the object is the user ID from the request. The value is an array of objects, each describing an event in which the user is busy during the specified period |
Event Object
|
Name |
Description |
|
ID |
Event ID |
|
NAME |
Event name |
|
DATE_FROM |
Start date and time of the event |
|
DATE_TO |
End date and time of the event |
|
DATE_FROM_TS_UTC |
Start date and time of the event in UTC in timestamp format |
|
DATE_TO_TS_UTC |
End date and time of the event in UTC in timestamp format |
|
~USER_OFFSET_FROM |
Time offset of the start of the event relative to UTC in seconds |
|
~USER_OFFSET_TO |
Time offset of the end of the event relative to UTC in seconds |
|
DT_SKIP_TIME |
Flag indicating that the event lasts all day. Possible values:
|
|
TZ_FROM |
Time zone of the event start date |
|
TZ_TO |
Time zone of the event end date |
|
ACCESSIBILITY |
Availability of event participants. Possible values:
|
|
IMPORTANCE |
Importance of the event. Possible values:
|
|
EVENT_TYPE |
Some events contain information about how they were created. An event can be created through:
|
Error Handling
HTTP Status: 400
{
"error": "",
"error_description": "The required parameter "from" for the method "calendar.accessibility.get" is not set."
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Code |
Error Message |
Description |
|
Empty string |
The required parameter "from" for the method "calendar.accessibility.get" is not set. |
The required parameter |
|
Empty string |
The required parameter "to" for the method "calendar.accessibility.get" is not set. |
The required parameter |
|
Empty string |
The required parameter "users" for the method "calendar.accessibility.get" is not set. |
The required parameter |
|
Empty string |
Access denied |
Access to the method is prohibited for external users |
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
- Calendar Events: Overview of Methods
- Get the participation status of the current user in the event calendar.meeting.status.get
- Set Participation Status in Event for Current User calendar.meeting.status.set