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

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

Booking clients

Booking clients are the CRM contacts and companies a booking is made for. The methods in this subsection read the booking clients, replace their whole set, and remove all clients in one call.

Bitrix24 API: booking.v1.booking.client.list, booking.v1.booking.client.set, booking.v1.booking.client.unset Scope: booking

List booking clients

GET /v1/bookings/:id/clients

Returns the CRM contacts and companies recorded as clients of the booking.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionBooking ID. List: GET /v1/bookings

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/bookings/53/clients" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/bookings/53/clients" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bookings/53/clients', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
const contacts = data.filter((client) => client.type.code === 'CONTACT')
console.log('Booking contacts:', contacts.map((client) => client.id))

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bookings/53/clients', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success
Fielddata Typearray DescriptionBooking clients. A booking without clients returns an empty array
Fielddata[].id Typenumber DescriptionCRM contact or company ID. Get: GET /v1/contacts/:id, GET /v1/companies/:id
Fielddata[].type.code Typestring DescriptionClient type code: CONTACT — contact, COMPANY — company. Dictionary: GET /v1/booking-client-types
Fielddata[].type.module Typestring DescriptionClient type module: crm

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": 3013,
      "type": {
        "code": "CONTACT",
        "module": "crm"
      }
    },
    {
      "id": 3149,
      "type": {
        "code": "COMPANY",
        "module": "crm"
      }
    }
  ]
}

Error response example

404 — no booking with this id exists:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Booking record not found"
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo booking with this id exists. Message: Booking record not found
HTTP400 CodeINVALID_PARAMS Descriptionid is not a positive integer. Message: id must be a canonical positive safe integer
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 tokens
HTTP403 CodeSCOPE_DENIED DescriptionThe key does not have the booking scope
HTTP429 CodeRATE_LIMITED DescriptionRequest rate exceeded. The effective cap is in the x-ratelimit-limit header
HTTP502 CodeBITRIX_RESPONSE_INVALID DescriptionBitrix24 returned a client list of an unexpected shape

Full list of common API errors — Errors.

See also