# calendar.settings.get

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

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

## Описание

Метод получает основные настройки календаря. Изменить основные настройки может только администратор портала.

Без параметров.

## Ответ

HTTP-статус: 200

```json
{
    "result": {
        "work_time_start": "9",
        "work_time_end": "19",
        "year_holidays": "1.01,2.01,7.01,23.02,8.03,1.05,9.05,12.06,4.11",
        "year_workdays": "31.12",
        "week_holidays": [
            "SA",
            "SU"
        ],
        "week_start": "MO",
        "user_name_template": "#NAME# #LAST_NAME#",
        "sync_by_push": false,
        "user_show_login": true,
        "path_to_user": "/company/personal/user/#user_id#/",
        "path_to_user_calendar": "/company/personal/user/#user_id#/calendar/",
        "path_to_group": "/workgroups/group/#group_id#/",
        "path_to_group_calendar": "/workgroups/group/#group_id#/calendar/",
        "path_to_vr": "",
        "path_to_rm": "",
        "rm_iblock_type": "",
        "rm_iblock_id": "",
        "dep_manager_sub": true,
        "denied_superpose_types": [],
        "pathes_for_sites": "",
        "forum_id": "8",
        "rm_for_sites": true,
        "path_to_type_company_calendar": "",
        "path_to_type_location": "",
        "path_to_type_open_event": ""
    },
    "time": {
        "start": 1733924639.802569,
        "finish": 1733924640.184363,
        "duration": 0.3817939758300781,
        "processing": 0.012382984161376953,
        "date_start": "2024-12-11T13:43:59+00:00",
        "date_finish": "2024-12-11T13:44:00+00:00"
    }
}
```

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

- `result` `object`. Корневой элемент ответа
- `work_time_start` `string`. Время начала рабочего дня
- `work_time_end` `string`. Время окончания рабочего дня
- `year_holidays` `string`. Список праздничных дней
- `week_holidays` `array`. Массив выходных дней
- `week_start` `string`. День начала недели
- `user_name_template` `string`. Шаблон имени пользователя
- `sync_by_push` `boolean`. Флаг автоматической синхронизации календарей по подписке. Push-события от Google/Office365
- `user_show_login` `boolean`. Флаг отображения логина пользователя
- `path_to_user` `string`. Шаблон ссылки на профиль пользователя
- `path_to_user_calendar` `string`. Шаблон ссылки на просмотр календаря пользователя
- `path_to_group` `string`. Шаблон ссылки на просмотр рабочей группы
- `path_to_group_calendar` `string`. Шаблон ссылки на просмотр календаря группы
- `path_to_vr` `string`. Шаблон ссылки к видеопереговорной
- `path_to_rm` `string`. Шаблон ссылки к переговорной
- `rm_iblock_type` `string`. Тип инфоблока бронирования переговорных и видеопереговорных
- `rm_iblock_id` `string`. Идентификатор инфоблока бронирования переговорных
- `dep_manager_sub` `boolean`. Флаг разрешения начальникам просматривать календари подчиненных
- `denied_superpose_types` `array`. Список типов календарей, которые не могут быть добавлены в избранные
- `pathes_for_sites` `boolean`. Устанавливает шаблоны ссылок общие для всех сайтов
- `forum_id` `string`. Идентификатор форума для комментариев
- `rm_for_sites` `boolean`. Устанавливает параметры переговорных общие для всех сайтов
- `path_to_type_company_calendar` `string`. Шаблон ссылки на просмотр календарей компании
- `path_to_type_location` `string`. Шаблон ссылки на просмотр бронирования переговорных
- `path_to_type_open_event` `string`. Шаблон ссылки на просмотр календаря открытых событий

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

### cURL (Webhook)

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

### cURL (OAuth)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/calendar.settings.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 } from '@bitrix24/b24jssdk'

declare const $b24: B24Frame

// Shape of the payload returned in result (match the "response handling" section of the page)
type CalendarSettingsResult = {
  work_time_start: string
  work_time_end: string
  year_holidays: string
  year_workdays: string
  week_holidays: string[]
  week_start: string
  user_name_template: string
  sync_by_push: boolean
  user_show_login: boolean
  path_to_user: string
  path_to_user_calendar: string
  path_to_group: string
  path_to_group_calendar: string
  path_to_vr: string
  path_to_rm: string
  rm_iblock_type: string
  rm_iblock_id: string
  dep_manager_sub: boolean
  denied_superpose_types: string[]
  pathes_for_sites: string
  forum_id: string
  rm_for_sites: boolean
  path_to_type_company_calendar: string
  path_to_type_location: string
  path_to_type_open_event: string
}

try {
  const response = await $b24.actions.v2.call.make<CalendarSettingsResult>({
    method: 'calendar.settings.get',
    params: {},
    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('Calendar settings:', result.work_time_start, result.work_time_end)
  }
} 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 getCalendarSettings() {
    try {
      // Initialize the SDK inside a Bitrix24 frame
      const $b24 = await B24Js.initializeB24Frame()

      const response = await $b24.actions.v2.call.make({
        method: 'calendar.settings.get',
        params: {},
        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('Calendar settings:', result.work_time_start, result.work_time_end)
    } catch (error) {
      // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
      console.error(error)
    }
  }

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

### Python

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

try:
    bitrix_response = client.calendar.settings.get().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.settings.get',
            []
        );

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

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

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

### BX24.js

```js
BX24.callMethod(
    'calendar.settings.get',
    {}
);
```

### PHP CRest

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

$result = CRest::call(
    'calendar.settings.get',
    []
);

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

### Go

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

var item struct {
	WorkTimeStart    string `json:"work_time_start"`
	WorkTimeEnd      string `json:"work_time_end"`
	YearHolidays     string `json:"year_holidays"`
	YearWorkdays     string `json:"year_workdays"`
	WeekStart        string `json:"week_start"`
	UserNameTemplate string `json:"user_name_template"`
}
if err := json.Unmarshal(res.Result, &item); err != nil {
	return fmt.Errorf("разбор ответа: %w", err)
}
fmt.Println(item.WorkTimeStart, item.WorkTimeEnd)
```

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