Get Resource Bookings by Filter calendar.resource.booking.list
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
Scope:
calendarWho can execute the method: any user
This method retrieves resource bookings based on a filter.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
filter* |
Filter fields |
Filter Parameter
Required parameters are marked with *
|
Name |
Description |
|
resourceTypeIdList* |
List of resource identifiers. Identifiers can be obtained using the method calendar.resource.list |
|
from |
Start date of the period |
|
to |
End date of the period |
|
resourceIdList* |
List of resource booking identifiers from the custom field of type Identifiers can be obtained via:
To find out which custom fields have the type |
In the method calendar.resource.booking.list, you must use only one of the two required parameters: resourceTypeIdList or resourceIdList. Both parameters cannot be used together.
Code Examples
Example 1. Assess resource availability over a period, for instance, to create custom views of availability or for use in application logic.
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"filter":{"resourceTypeIdList":[10852,10888,10873,10871,10853],"from":"2024-06-20","to":"2024-08-20"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/calendar.resource.booking.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"filter":{"resourceTypeIdList":[10852,10888,10873,10871,10853],"from":"2024-06-20","to":"2024-08-20"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/calendar.resource.booking.list
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of each booking returned in result[]
type ResourceBooking = {
ID: string
PARENT_ID: string
DELETED: string
CAL_TYPE: string
OWNER_ID: string
NAME: string
DATE_FROM: string
DATE_TO: string
TZ_FROM: string
TZ_TO: string
TZ_OFFSET_FROM: string
TZ_OFFSET_TO: string
DATE_FROM_TS_UTC: string
DATE_TO_TS_UTC: string
DT_SKIP_TIME: string
DT_LENGTH: number
EVENT_TYPE: string
CREATED_BY: string
DATE_CREATE: string
TIMESTAMP_X: string
DESCRIPTION: string
IS_MEETING: boolean
MEETING_STATUS: string
MEETING_HOST: string
VERSION: string
SECTION_ID: string
DATE_FROM_FORMATTED: string
DATE_TO_FORMATTED: string
SECT_ID: string
RESOURCE_BOOKING_ID: string
}
try {
// calendar.resource.booking.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make<ResourceBooking[]>({
method: 'calendar.resource.booking.list',
params: {
filter: {
resourceTypeIdList: [10852, 10888, 10873, 10871, 10853],
from: '2024-06-20',
to: '2024-08-20',
},
start: 0,
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Bookings on this page:', result.length, result)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function fetchResourceBookings() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
// calendar.resource.booking.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make({
method: 'calendar.resource.booking.list',
params: {
filter: {
resourceTypeIdList: [10852, 10888, 10873, 10871, 10853],
from: '2024-06-20',
to: '2024-08-20',
},
start: 0,
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Bookings on this page:', result.length, result)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', fetchResourceBookings)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.calendar.resource.booking.list(
filter={
"resourceTypeIdList": [
10852,
10888,
10873,
10871,
10853,
],
"from": "2024-06-20",
"to": "2024-08-20",
},
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
try {
$response = $b24Service
->core
->call(
'calendar.resource.booking.list',
[
'filter' => [
'resourceTypeIdList' => [10852, 10888, 10873, 10871, 10853],
'from' => '2024-06-20',
'to' => '2024-08-20',
],
]
);
$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 fetching resource booking list: ' . $e->getMessage();
}
BX24.callMethod(
'calendar.resource.booking.list',
{
filter: {
resourceTypeIdList: [10852, 10888, 10873, 10871, 10853],
from: '2024-06-20',
to: '2024-08-20',
}
}
);
require_once('crest.php');
$result = CRest::call(
'calendar.resource.booking.list',
[
'filter' => [
'resourceTypeIdList' => [10852, 10888, 10873, 10871, 10853],
'from' => '2024-06-20',
'to' => '2024-08-20'
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client and ctx are already created — see the Go SDK section
res, err := client.Core().Call(ctx, "calendar.resource.booking.list", b24.Params{
"filter": b24.Params{
"resourceTypeIdList": []int{10852, 10888, 10873, 10871, 10853},
"from": "2024-06-20",
"to": "2024-08-20",
},
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("calendar.resource.booking.list: %w", err)
}
// The response arrives as json.RawMessage — unmarshal it
// into a struct matching the response shape shown below on this page.
fmt.Printf("%s\n", res.Result)
Example 2. Select bookings by their identifiers from CRM custom fields.
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"filter":{"resourceIdList":[10,18,17]}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/calendar.resource.booking.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"filter":{"resourceIdList":[10,18,17]},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/calendar.resource.booking.list
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// Shape of each booking returned in result[]
type ResourceBooking = {
ID: string
PARENT_ID: string
DELETED: string
CAL_TYPE: string
OWNER_ID: string
NAME: string
DATE_FROM: string
DATE_TO: string
TZ_FROM: string
TZ_TO: string
TZ_OFFSET_FROM: string
TZ_OFFSET_TO: string
DATE_FROM_TS_UTC: string
DATE_TO_TS_UTC: string
DT_SKIP_TIME: string
DT_LENGTH: number
EVENT_TYPE: string
CREATED_BY: string
DATE_CREATE: string
TIMESTAMP_X: string
DESCRIPTION: string
IS_MEETING: boolean
MEETING_STATUS: string
MEETING_HOST: string
VERSION: string
SECTION_ID: string
DATE_FROM_FORMATTED: string
DATE_TO_FORMATTED: string
SECT_ID: string
RESOURCE_BOOKING_ID: string
}
try {
// calendar.resource.booking.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make<ResourceBooking[]>({
method: 'calendar.resource.booking.list',
params: {
filter: {
resourceIdList: [10, 18, 17],
},
start: 0,
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info('Bookings on this page:', result.length, result)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function fetchResourceBookings() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
// calendar.resource.booking.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make({
method: 'calendar.resource.booking.list',
params: {
filter: {
resourceIdList: [10, 18, 17],
},
start: 0,
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info('Bookings on this page:', result.length, result)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', fetchResourceBookings)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.calendar.resource.booking.list(
filter={
"resourceIdList": [
10,
18,
17,
],
},
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
try {
$response = $b24Service
->core
->call(
'calendar.resource.booking.list',
[
'filter' => [
'resourceIdList' => [10, 18, 17]
]
]
);
$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 fetching resource booking list: ' . $e->getMessage();
}
BX24.callMethod(
'calendar.resource.booking.list',
{
filter: {
resourceIdList: [10, 18, 17]
}
}
);
require_once('crest.php');
$result = CRest::call(
'calendar.resource.booking.list',
[
'filter' => [
'resourceIdList' => [10, 18, 17]
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client and ctx are already created — see the Go SDK section
res, err := client.Core().Call(ctx, "calendar.resource.booking.list", b24.Params{
"filter": b24.Params{
"resourceIdList": []int{10, 18, 17},
},
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("calendar.resource.booking.list: %w", err)
}
// The response arrives as json.RawMessage — unmarshal it
// into a struct matching the response shape shown below on this page.
fmt.Printf("%s\n", res.Result)
Response Handling
HTTP Status: 200
{
"result": [
{
"ID": "1408",
"PARENT_ID": "1408",
"DELETED": "N",
"CAL_TYPE": "resource",
"OWNER_ID": "0",
"NAME": "Booking",
"DATE_FROM": "20.12.2024 00:00:00",
"DATE_TO": "21.12.2024 00:00:00",
"TZ_FROM": "Europe/Riga",
"TZ_TO": "Europe/Riga",
"TZ_OFFSET_FROM": "7200",
"TZ_OFFSET_TO": "7200",
"DATE_FROM_TS_UTC": "1734652800",
"DATE_TO_TS_UTC": "1734739200",
"DT_SKIP_TIME": "Y",
"DT_LENGTH": 172800,
"EVENT_TYPE": "#resourcebooking#",
"CREATED_BY": "1",
"DATE_CREATE": "18.12.2024 13:55:35",
"TIMESTAMP_X": "18.12.2024 13:55:35",
"DESCRIPTION": "Service: some",
"IS_MEETING": false,
"MEETING_STATUS": "Y",
"MEETING_HOST": "0",
"VERSION": "1",
"SECTION_ID": "198",
"DATE_FROM_FORMATTED": "Fri Dec 20 2024",
"DATE_TO_FORMATTED": "Sat Dec 21 2024",
"SECT_ID": "198",
"RESOURCE_BOOKING_ID": "10"
},
{
"ID": "1409",
...
}
],
"time": {
"start": 1733318565.183275,
"finish": 1733318565.695058,
"duration": 0.5117831230163574,
"processing": 0.29406094551086426,
"date_start": "2024-12-04T13:22:45+00:00",
"date_finish": "2024-12-04T13:22:45+00:00"
}
}
Returned Data
|
Name |
Description |
|
result |
Array of objects. Each object describes a booking |
Booking Object
Technically, a booking is a calendar event. The method retrieves a set of fields similar to those of a calendar event. Some fields remain empty as they are not relevant for bookings. Below are only the relevant or filled fields.
|
Name |
Description |
|
ID |
Booking identifier |
|
PARENT_ID |
For a booking object, always equal to the |
|
DELETED |
Flag indicating whether the booking is deleted. Possible values:
|
|
CAL_TYPE |
Type of calendar in which the booking is located |
|
OWNER_ID |
For a booking object, always equals |
|
NAME |
Name of the booking |
|
DATE_FROM |
Start date of the booking |
|
DATE_TO |
End date of the booking |
|
TZ_FROM |
Timezone of the start date of the booking |
|
TZ_TO |
Timezone of the end date of the booking |
|
TZ_OFFSET_FROM |
Time offset of the start of the booking relative to UTC in seconds |
|
TZ_OFFSET_TO |
Time offset of the end of the booking relative to UTC in seconds |
|
DATE_FROM_TS_UTC |
Start date and time of the booking in UTC in timestamp format |
|
DATE_TO_TS_UTC |
End date and time of the booking in UTC in timestamp format |
|
DT_SKIP_TIME |
Flag indicating whether the booking lasts all day. Possible values:
|
|
DT_LENGTH |
Duration of the booking in seconds |
|
EVENT_TYPE |
Type of booking |
|
CREATED_BY |
Identifier of the user who created the booking |
|
DATE_CREATE |
Creation date of the booking |
|
TIMESTAMP_X |
Date of modification of the booking |
|
DESCRIPTION |
Description of the booking |
|
IS_MEETING |
For a booking object, always |
|
MEETING_STATUS |
For a booking object, always |
|
MEETING_HOST |
For a booking object, always |
|
VERSION |
Version of booking changes |
|
SECTION_ID |
Identifier of the resource in which the booking is located |
|
DATE_FROM_FORMATTED |
Formatted start date of the booking |
|
DATE_TO_FORMATTED |
Formatted end date of the booking |
|
SECT_ID |
Identifier of the resource in which the booking is located |
|
RESOURCE_BOOKING_ID |
Booking identifier |
Error Handling
HTTP Status: 400
{
"error": "",
"error_description": "The required parameter \"filter['resourceTypeIdList']\" is not set for the method \"calendar.resource.booking.list\""
}
|
Name |
Description |
|
error |
String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only |
|
error_description |
Error message for the developer. Do not show it to the end user without processing |
Possible Error Codes
|
Code |
Error Message |
Description |
|
Empty value |
Access denied |
Access to the method is prohibited for external users |
|
Empty value |
The required parameter "filter['resourceTypeIdList']" is not set for the method "calendar.resource.booking.list" |
Neither of the required parameters |
Statuses and System Error Codes
HTTP Status: 4xx, 5xx
The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit |
|
|
|
The request contains no authorization data: neither an access token nor a webhook code was passed |
|
|
|
Methods are called over the HTTPS protocol only |
|
|
|
The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support |
|
|
|
REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — |
|
|
|
No active webhook with the specified user identifier and secret code was found |
|
|
|
No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope |
|
|
|
The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with |
|
|
|
The access token has expired |
|
|
|
The application is installed, but the Bitrix24 administrator has granted access to it only to specific users |
|
|
|
The public part of the site is closed. To open it on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |