# calendar.section.get

URL: https://chugunov.pro/api-bitrix24/calendar/calendar-section-get/
Проверено на Битрикс24 REST API, обновлено 11.09.2026 (ревизия источника fb39d6c).
Источник: официальная документация Битрикс24 (bitrix-tools/b24-rest-docs, лицензия MIT, © Bitrix). Справочник независимый, официальной документацией не является.

Получить список календарей
Scope: `calendar`
Кто может выполнять метод: любой пользователь

## Описание

Метод получает список календарей.

## Параметры

- `type` `string` — обязательный. Тип календаря: 
  - `user` — календарь пользователя
  - `group` — календарь группы
  - `company_calendar` — календарь компании 
  - `location` — календарь переговорной комнаты. Используется для бронирования времени в календаре переговорной комнаты через стороннее приложение
  - другие типы, в том числе пользовательские
- `ownerId` `integer` — обязательный. Идентификатор владельца календаря.
  Параметр можно не передавать, если тип календаря `user`. В этом случае используется идентификатор текущего пользователя.
  Для типа календаря `location` параметр `ownerId` должен иметь значение `0`

## Ответ

HTTP-статус: 200

```json
{
    "result": [
        {
            "ID": "190",
            "NAME": "New Section",
            "GAPI_CALENDAR_ID": null,
            "DESCRIPTION": "Description for section",
            "COLOR": "#9cbeee",
            "TEXT_COLOR": "#283000",
            "EXPORT": {
                "ALLOW": true
            },
            "CAL_TYPE": "user",
            "OWNER_ID": "1",
            "CREATED_BY": "1",
            "DATE_CREATE": "2024-12-10 06:36:00",
            "TIMESTAMP_X": "2024-12-10 06:36:00",
            "CAL_DAV_CON": null,
            "SYNC_TOKEN": null,
            "PAGE_TOKEN": null,
            "EXTERNAL_TYPE": "local",
            "ACCESS": {
                "D114": 17,
                "G2": 13,
                "U2": 15,
                "U1": 19
            },
            "IS_COLLAB": false,
            "PERM": {
                "view_time": true,
                "view_title": true,
                "view_full": true,
                "add": true,
                "edit": true,
                "edit_section": true,
                "access": true
            }
        },
        {
            "ID": "191",
            ...
        }
        {
            "ID": "192",
            ...
        }
    ],
    "time": {
        "start": 1733828946.418185,
        "finish": 1733828946.650208,
        "duration": 0.23202300071716309,
        "processing": 0.0054471492767333984,
        "date_start": "2024-12-08T11:09:06+00:00",
        "date_finish": "2024-12-08T11:09:06+00:00"
    }
}
```

### Возвращаемые данные

- `result` `array`. Массив календарей
- `ID` `string`. Идентификатор календаря
- `NAME` `string`. Название календаря
- `GAPI_CALENDAR_ID` `string`. Идентификатор синхронизации
- `DESCRIPTION` `string`. Описание календаря
- `COLOR` `string`. Цвет календаря
- `TEXT_COLOR` `string`. Цвет текста в календаре
- `EXPORT` `object`. Объект с [параметрами экспорта календаря](#export)
- `CAL_TYPE` `string`. Тип календаря
- `OWNER_ID` `string`. Идентификатор владельца календаря. 
  Для типа Календарь пользователя `user` поле содержит идентификатор пользователя. Для Календаря группы `group` — идентификатор группы
- `CREATED_BY` `string`. Идентификатор создателя календаря
- `DATE_CREATE` `datetime`. Дата создания календаря
- `TIMESTAMP_X` `datetime`. Дата изменения календаря
- `CAL_DAV_CON` `string`. Идентификатор синхронизации
- `SYNC_TOKEN` `string`. Идентификатор синхронизации
- `PAGE_TOKEN` `string`. Идентификатор синхронизации
- `EXTERNAL_TYPE` `string`. Тип провайдера для синхронизации
- `ACCESS` `object`. Объект данных доступа к календарю. 
  Ключ объекта — идентификатор прав доступа. Получить название прав доступа можно методом [access.name](https://chugunov.pro/api-bitrix24/common/system/access-name/). Определить права доступа для текущего пользователя — методом [user.access](https://chugunov.pro/api-bitrix24/common/users/user-access/).
  Значение обьекта содержит числовой идентификатор разрешения на право доступа. Индентификаторы разрешения на право доступа отличаются на разных порталах. На текущий момент узнать все идентификаторы может только администратор портала в коробочной версии Битрикс24
- `IS_COLLAB` `boolean`. Флаг принадлежности календаря к коллабе
- `PERM` `object`. Объект [прав доступа](#perm) текущего пользователя к календарю

## Ошибки

HTTP-статус: 400

```json
{
    "error": "",
    "error_description": "Не задан обязательный параметр \"type\" для метода \"calendar.section.get\""
}
```

- — — Не задан обязательный параметр "type" для метода "calendar.section.get". Не передан обязательный параметр `type`
- — — Не задан обязательный параметр "ownerId" для метода "calendar.section.get". Не передан обязательный параметр `ownerId` и параметр `type` не равен `user`
- — — Доступ запрещен. Запрещен доступ к методу для внешних пользователей

## Примеры запроса

### cURL (Webhook)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"type":"user","ownerId":1}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/calendar.section.get
```

### cURL (OAuth)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"type":"user","ownerId":1,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/calendar.section.get
```

### JS (TS)

```ts
// 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, ISODate } from '@bitrix24/b24jssdk'

declare const $b24: B24Frame

// Shape of each CalendarSection returned in result[]
type CalendarSection = {
  ID: string
  NAME: string
  GAPI_CALENDAR_ID: string | null
  DESCRIPTION: string
  COLOR: string
  TEXT_COLOR: string
  EXPORT: { ALLOW: boolean }
  CAL_TYPE: string
  OWNER_ID: string
  CREATED_BY: string
  DATE_CREATE: ISODate | null
  TIMESTAMP_X: ISODate | null
  CAL_DAV_CON: string | null
  SYNC_TOKEN: string | null
  PAGE_TOKEN: string | null
  EXTERNAL_TYPE: string
  ACCESS: Record<string, number>
  IS_COLLAB: boolean
  PERM: {
    view_time: boolean
    view_title: boolean
    view_full: boolean
    add: boolean
    edit: boolean
    edit_section: boolean
    access: boolean
  }
}

try {
  // calendar.section.get 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<CalendarSection[]>({
    method: 'calendar.section.get',
    params: {
      type: 'user',
      ownerId: 1,
      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('Sections count:', result.length, 'first section:', result[0])
  }
} catch (error) {
  // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
  console.error(error)
}
```

### JS (UMD)

```html
<!-- 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 getCalendarSections() {
    try {
      // Initialize the SDK inside a Bitrix24 frame
      const $b24 = await B24Js.initializeB24Frame()

      // calendar.section.get 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.section.get',
        params: {
          type: 'user',
          ownerId: 1,
          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('Sections count:', result.length, 'first section:', result[0])
    } catch (error) {
      // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
      console.error(error)
    }
  }

  document.addEventListener('DOMContentLoaded', getCalendarSections)
</script>
```

### Python

```python
from b24pysdk.errors import BitrixAPIError, BitrixSDKException

try:
    bitrix_response = client.calendar.section.get(
        type="user",
        owner_id=1,
    ).response
    result = bitrix_response.result
    print(result)
except BitrixAPIError as error:
    print(
        "Ошибка Bitrix API",
        f"error: {error.error}",
        f"error_description: {error.error_description}",
        sep="\n",
    )
except BitrixSDKException as error:
    print(f"Ошибка Bitrix SDK: {error.message}")
except Exception as error:
    print(f"Непредвиденная ошибка: {error}")
```

### PHP

```php
try {
    $response = $b24Service
        ->core
        ->call(
            'calendar.section.get',
            [
                'type'    => 'user',
                'ownerId' => 1
            ]
        );

    $result = $response
        ->getResponseData()
        ->getResult();

    echo 'Success: ' . print_r($result, true);
    // Нужная вам логика обработки данных
    processData($result);

} catch (Throwable $e) {
    error_log($e->getMessage());
    echo 'Error getting calendar section: ' . $e->getMessage();
}
```

### BX24.js

```js
BX24.callMethod(
    'calendar.section.get',
    {
        type: 'user',
        ownerId: 1
    }
);
```

### PHP CRest

```php
require_once('crest.php');

$result = CRest::call(
    'calendar.section.get',
    [
        'type' => 'user',
        'ownerId' => 1
    ]
);

echo '<PRE>';
print_r($result);
echo '</PRE>';
```

### Go

```go
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "calendar.section.get", b24.Params{
	"type":    "user",
	"ownerId": 1,
}, b24.WithIdempotent())
if err != nil {
	return fmt.Errorf("calendar.section.get: %w", err)
}

// Ответ приходит как json.RawMessage — разберите его
// в структуру под форму ответа, показанную ниже на этой странице.
fmt.Printf("%s\n", res.Result)
```

Оригинал в официальной документации: https://apidocs.bitrix24.ru/api-reference/calendar/calendar-section-get.html
