لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/booking-resources.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Booking resources

A booking resource is a specialist, room or piece of equipment that clients book online. Each resource belongs to one type, and a booking reserves one or more resources.

Bitrix24 API: booking.v1.resource.* Scope: booking

Create: Booking resources

POST /v1/booking-resources

Creates a booking resource — a specialist, a room or a piece of equipment that clients book online.

Fields go at the root of the JSON, without a fields wrapper.

Request fields (body)

The minimum for creation is name and typeId.

Field Type Required Description
Fieldname Typestring Requiredyes DescriptionResource name
FieldtypeId Typenumber Requiredyes DescriptionResource type ID. List: GET /v1/booking-resource-types. Without this field the request is rejected with 422 BITRIX_ERROR
Fielddescription Typestring | null Requiredno DescriptionResource description. Default null
FieldisMain Typeboolean | string Requiredno DescriptionMain resource. true / false or "Y" / "N". Default true
FieldisInfoNotificationOn Typeboolean | string Requiredno DescriptionBooking info message to the client. true / false or "Y" / "N". Default true
FieldisConfirmationNotificationOn Typeboolean | string Requiredno DescriptionBooking confirmation request. Default true
FieldisReminderNotificationOn Typeboolean | string Requiredno DescriptionBooking reminder. Default true
FieldisFeedbackNotificationOn Typeboolean | string Requiredno DescriptionFeedback request. Default true
FieldisDelayedNotificationOn Typeboolean | string Requiredno DescriptionMessage to a client who is running late. Default true
FieldisCancellationNotificationOn Typeboolean | string Requiredno DescriptionBooking cancellation message to the client. Default true
FieldsenderCode Typestring | null Requiredno DescriptionService that sends messages to the client. Default bitrix24
FieldinfoNotificationDelay Typenumber | null Requiredno DescriptionHow many seconds after the booking is made to send the booking info message. Default null
FieldconfirmationNotificationDelay Typenumber | null Requiredno DescriptionHow many seconds before the booking to send the first confirmation request. Default 86400
FieldconfirmationNotificationRepetitions Typenumber | null Requiredno DescriptionHow many times to repeat the confirmation request, not counting the first one. Default null
FieldconfirmationNotificationRepetitionsInterval Typenumber | null Requiredno DescriptionInterval between repeats of the confirmation request, in seconds. Default 10800
FieldconfirmationCounterDelay Typenumber | null Requiredno DescriptionHow many seconds before the booking an unconfirmed booking enters the counter. Default 10800
FieldreminderNotificationDelay Typenumber | null Requiredno DescriptionHow many seconds before the booking to send the reminder. -1 — on the morning of the booking day. Default -1
FielddelayedNotificationDelay Typenumber | null Requiredno DescriptionAfter how many seconds of lateness to send the message to the client. Default 300
FielddelayedCounterDelay Typenumber | null Requiredno DescriptionAfter how many seconds of lateness the booking enters the calendar counter. Default 300
FieldcancellationNotificationDelay Typenumber | null Requiredno DescriptionDelay of the booking cancellation message, in seconds. Default 600
FieldtemplateTypeInfo Typestring Requiredno DescriptionBooking message template: inanimate, animate, inanimate_long. Default inanimate
FieldtemplateTypeConfirmation Typestring Requiredno DescriptionConfirmation request template: inanimate, animate, inanimate_long. Default inanimate
FieldtemplateTypeReminder Typestring Requiredno DescriptionReminder template. The only value is base
FieldtemplateTypeFeedback Typestring Requiredno DescriptionFeedback request template: inanimate, animate. Default inanimate
FieldtemplateTypeDelayed Typestring Requiredno DescriptionLate-arrival message template: inanimate, animate. Default inanimate

All six client messages are enabled by default. To stop the resource from sending them, pass false in each of the six is…NotificationOn fields, as in the examples below.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/booking-resources" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Room 3",
    "description": "Appointments only",
    "typeId": 1,
    "isInfoNotificationOn": false,
    "isConfirmationNotificationOn": false,
    "isReminderNotificationOn": false,
    "isFeedbackNotificationOn": false,
    "isDelayedNotificationOn": false,
    "isCancellationNotificationOn": false
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/booking-resources" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Room 3",
    "description": "Appointments only",
    "typeId": 1,
    "isInfoNotificationOn": false,
    "isConfirmationNotificationOn": false,
    "isReminderNotificationOn": false,
    "isFeedbackNotificationOn": false,
    "isDelayedNotificationOn": false,
    "isCancellationNotificationOn": false
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resources', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Room 3',
    description: 'Appointments only',
    typeId: 1,
    isInfoNotificationOn: false,
    isConfirmationNotificationOn: false,
    isReminderNotificationOn: false,
    isFeedbackNotificationOn: false,
    isDelayedNotificationOn: false,
    isCancellationNotificationOn: false,
  }),
})

const { data } = await res.json()
console.log('Resource ID:', data.id)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/booking-resources', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Room 3',
    description: 'Appointments only',
    typeId: 1,
    isInfoNotificationOn: false,
    isConfirmationNotificationOn: false,
    isReminderNotificationOn: false,
    isFeedbackNotificationOn: false,
    isDelayedNotificationOn: false,
    isCancellationNotificationOn: false,
  }),
})

const { data } = await res.json()
console.log('Resource ID:', data.id)

Response fields

On success, the HTTP status is 201 Created.

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata Typeobject DescriptionCard of the created resource. The card fields are in the "Response fields" section of the Get a booking resource page
Fielddata.id Typenumber DescriptionResource ID. Pass it in resourceIds when creating a booking

Response example

JSON
{
  "success": true,
  "data": {
    "id": 51,
    "description": "Appointments only",
    "typeId": 1,
    "isMain": true,
    "name": "Room 3",
    "senderCode": "bitrix24",
    "isInfoNotificationOn": false,
    "isConfirmationNotificationOn": false,
    "isReminderNotificationOn": false,
    "isFeedbackNotificationOn": false,
    "isDelayedNotificationOn": false,
    "isCancellationNotificationOn": false,
    "infoNotificationDelay": null,
    "confirmationNotificationDelay": 86400,
    "confirmationNotificationRepetitions": null,
    "confirmationNotificationRepetitionsInterval": 10800,
    "confirmationCounterDelay": 10800,
    "reminderNotificationDelay": -1,
    "delayedNotificationDelay": 300,
    "delayedCounterDelay": 300,
    "cancellationNotificationDelay": 600,
    "templateTypeInfo": "inanimate",
    "templateTypeConfirmation": "inanimate",
    "templateTypeReminder": "base",
    "templateTypeFeedback": "inanimate",
    "templateTypeDelayed": "inanimate"
  }
}

Error response example

422 — there is no resource type with this typeId:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Resource type with id 999999 does not exist",
    "b24Code": "1013"
  }
}

Errors

HTTP Code Description
HTTP400 CodeMISSING_REQUIRED_FIELDS Descriptionname is not passed. Message name is required
HTTP400 CodeREADONLY_FIELD Descriptionid is passed in the body. Message id is read-only
HTTP400 CodeINVALID_PARAMS DescriptionEmpty body. Message Provide a non-empty object of fields
HTTP400 CodeINVALID_PARAMS DescriptionA field not listed in the "Request fields (body)" table. Message Unknown booking field
HTTP400 CodeINVALID_PARAMS DescriptionA field value is an object or an array. Message Fields must contain scalar values
HTTP422 CodeBITRIX_ERROR DescriptionThere is no resource type with this typeId, b24Code 1013
HTTP422 CodeBITRIX_ERROR DescriptiontypeId is not passed. Message ResourceType not found, b24Code 1006
HTTP422 CodeBITRIX_ERROR DescriptionInvalid template value, for example in templateTypeInfo. Message Invalid value of the templateTypeInfo field
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is not passed
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 tokens
HTTP403 CodeSCOPE_DENIED DescriptionThe key does not have the booking scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode
HTTP429 CodeRATE_LIMITED DescriptionRequest rate exceeded. The effective cap is in the x-ratelimit-limit header
HTTP502 CodeBITRIX_RESPONSE_INVALID DescriptionBitrix24 returned a response of an unexpected shape. If this happened while re-reading the card after the write, the resource has already been created — find it in the list before retrying

Full list of common API errors — Errors.

See also