# entity.section.get

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

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

## Описание

Метод `entity.section.get` получает список разделов хранилища данных приложения.

Метод работает только в контексте [приложения](https://apidocs.bitrix24.ru/settings/app-installation/index.html).

## Параметры

- `ENTITY` `string` — необязательный. Идентификатор хранилища данных приложения. Используйте значение, которое указали при создании хранилища.
  Получить идентификатор можно методом [entity.get](https://chugunov.pro/api-bitrix24/entity/entities/entity-get/)
- `SORT` `object` — необязательный. Объект формата:
  ```
  {
      field_1: value_1,
      field_2: value_2,
      ...,
      field_n: value_n
  }
  ```
  где:
  - `field_n` — поле сортировки
  - `value_n` — направление сортировки: `ASC` или `DESC`
  Список доступных полей для сортировки смотрите в разделе [Тип section](#section).
  По умолчанию используется `{"ID":"ASC"}`.
  Пример: `{"NAME":"ASC","ID":"DESC"}`
- `FILTER` `object` — необязательный. Объект формата:
  ```
  {
      field_1: value_1,
      field_2: value_2,
      ...,
      field_n: value_n
  }
  ```
  где:
  - `field_n` — поле фильтрации
  - `value_n` — значение фильтра
  Список доступных полей для фильтрации смотрите в разделе [Тип section](#section).
  К ключам `field_n` можно добавлять префиксы:
  - `>=` — больше либо равно
  - `>` — больше
  - `<=` — меньше либо равно
  - `<` — меньше
  - `=` — равно (по умолчанию)
  - `!=` или `!` — не равно
  - `><` — диапазон
  - `!><` — не в диапазоне
  - `%` — LIKE
  - `!%` — NOT LIKE
  - `?` — проверка на `null`/`not null`
- `start` `integer` — необязательный. Параметр постраничной навигации.
  Размер страницы фиксирован: `50` записей.
  Формула для получения N-й страницы:
  `start = (N - 1) * 50`
  Подробнее в статье [Особенности списочных методов](https://apidocs.bitrix24.ru/settings/how-to-call-rest-api/list-methods-pecularities.html)

## Ответ

HTTP-статус: 200

```json
{
    "result": [
        {
            "ID": "671",
            "CODE": null,
            "TIMESTAMP_X": "2026-03-23T17:15:51+03:00",
            "DATE_CREATE": "2026-03-23T17:15:51+03:00",
            "CREATED_BY": "577",
            "MODIFIED_BY": "577",
            "ACTIVE": "Y",
            "SORT": "500",
            "NAME": "Родительский раздел",
            "PICTURE": null,
            "DETAIL_PICTURE": null,
            "DESCRIPTION": null,
            "LEFT_MARGIN": "1",
            "RIGHT_MARGIN": "6",
            "DEPTH_LEVEL": "1",
            "ENTITY": "dish",
            "SECTION": null
        },
        {
            "ID": "669",
            "CODE": null,
            "TIMESTAMP_X": "2026-03-23T17:14:22+03:00",
            "DATE_CREATE": "2026-03-23T17:14:22+03:00",
            "CREATED_BY": "577",
            "MODIFIED_BY": "577",
            "ACTIVE": "Y",
            "SORT": "500",
            "NAME": "Тестовый раздел",
            "PICTURE": null,
            "DETAIL_PICTURE": null,
            "DESCRIPTION": null,
            "LEFT_MARGIN": "7",
            "RIGHT_MARGIN": "8",
            "DEPTH_LEVEL": "1",
            "ENTITY": "dish",
            "SECTION": null
        },
        {
            "ID": "673",
            "CODE": null,
            "TIMESTAMP_X": "2026-03-23T17:16:37+03:00",
            "DATE_CREATE": "2026-03-23T17:16:37+03:00",
            "CREATED_BY": "577",
            "MODIFIED_BY": "577",
            "ACTIVE": "Y",
            "SORT": "500",
            "NAME": "Тестовый раздел",
            "PICTURE": null,
            "DETAIL_PICTURE": null,
            "DESCRIPTION": null,
            "LEFT_MARGIN": "4",
            "RIGHT_MARGIN": "5",
            "DEPTH_LEVEL": "2",
            "ENTITY": "dish",
            "SECTION": "671"
        },
        {
            "ID": "675",
            "CODE": "testovyy-razdel",
            "TIMESTAMP_X": "2026-03-23T17:42:32+03:00",
            "DATE_CREATE": "2026-03-23T17:42:32+03:00",
            "CREATED_BY": "577",
            "MODIFIED_BY": "577",
            "ACTIVE": "Y",
            "SORT": "500",
            "NAME": "Тестовый раздел",
            "PICTURE": null,
            "DETAIL_PICTURE": null,
            "DESCRIPTION": "Описание тестового раздела",
            "LEFT_MARGIN": "2",
            "RIGHT_MARGIN": "3",
            "DEPTH_LEVEL": "2",
            "ENTITY": "dish",
            "SECTION": "671"
        }
    ],
    "total": 4,
    "time": {
        "start": 1774338416,
        "finish": 1774338416.415466,
        "duration": 0.4154660701751709,
        "processing": 0,
        "date_start": "2026-03-24T10:46:56+03:00",
        "date_finish": "2026-03-24T10:46:56+03:00",
        "operating_reset_at": 1774339016,
        "operating": 0
    }
}
```

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

- `result` `section[]`. Список разделов хранилища
- `total` `integer`. Общее количество разделов в выборке
- `next` `integer`. Смещение для получения следующей страницы (если есть)
- `time` `time`. Информация о времени выполнения запроса

## Ошибки

HTTP-статус: 400

```json
{
    "error": "ERROR_ARGUMENT",
    "error_description": "Argument 'ENTITY' is null or empty",
    "argument": "ENTITY"
}
```

- `ERROR_ARGUMENT` — Argument 'ENTITY' is null or empty. Параметр `ENTITY` не передан или пустой после очистки
- `ERROR_ARGUMENT` — Entity code is too long. Max length is N characters.. Слишком длинное значение `ENTITY`
- `ERROR_ENTITY_NOT_FOUND` — Entity not found. Хранилище с переданным `ENTITY` не найдено

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

### cURL (OAuth)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"ENTITY":"dish","SORT":{"NAME":"ASC"},"FILTER":{"ACTIVE":"Y"},"start":0,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/entity.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 SectionItem returned in result[]
type SectionItem = {
  ID: string
  CODE: string | null
  TIMESTAMP_X: ISODate
  DATE_CREATE: ISODate
  CREATED_BY: string
  MODIFIED_BY: string
  ACTIVE: 'Y' | 'N'
  SORT: string
  NAME: string
  PICTURE: string | null
  DETAIL_PICTURE: string | null
  DESCRIPTION: string | null
  LEFT_MARGIN: string
  RIGHT_MARGIN: string
  DEPTH_LEVEL: string
  ENTITY: string
  SECTION: string | null
}

try {
  // entity.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<SectionItem[]>({
    method: 'entity.section.get',
    params: {
      ENTITY: 'dish',
      SORT: { NAME: 'ASC' },
      FILTER: { ACTIVE: 'Y' },
      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:', result.length, result)
  }
} 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 fetchSections() {
    try {
      // Initialize the SDK inside a Bitrix24 frame
      const $b24 = await B24Js.initializeB24Frame()

      // entity.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: 'entity.section.get',
        params: {
          ENTITY: 'dish',
          SORT: { NAME: 'ASC' },
          FILTER: { ACTIVE: 'Y' },
          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:', result.length, result)
    } catch (error) {
      // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
      console.error(error)
    }
  }

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

### Python

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

try:
    bitrix_response = client.entity.section.get(
        entity="dish",
        sort={
            "NAME": "ASC",
        },
        filter={
            "ACTIVE": "Y",
        },
        start=0,
    ).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(
            'entity.section.get',
            [
                'ENTITY' => 'dish',
                'SORT' => ['NAME' => 'ASC'],
                'FILTER' => ['ACTIVE' => 'Y'],
                'start' => 0,
            ]
        );

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

    echo '<pre>';
    print_r($result);
    echo '</pre>';

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

### BX24.js

```js
BX24.callMethod(
    'entity.section.get',
    {
        ENTITY: 'dish',
        SORT: { NAME: 'ASC' },
        FILTER: { ACTIVE: 'Y' },
    },
    (result) => {
        if (result.error()) {
            console.error(result.error());
            return;
        }

        console.info(result.data());

        if (result.more()) {
            result.next();
        }
    },
);
```

### PHP CRest

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

$result = CRest::call(
    'entity.section.get',
    [
        'ENTITY' => 'dish',
        'SORT' => ['NAME' => 'ASC'],
        'FILTER' => ['ACTIVE' => 'Y'],
        'start' => 0,
    ]
);

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

### Go

```go
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "entity.section.get", b24.Params{
	"ENTITY": "dish",
	"SORT": b24.Params{
		"NAME": "ASC",
	},
	"FILTER": b24.Params{
		"ACTIVE": "Y",
	},
	"start": 0,
}, b24.WithIdempotent())
if err != nil {
	return fmt.Errorf("entity.section.get: %w", err)
}

var items []struct {
	ID         b24.ID `json:"ID"`
	TimestampX string `json:"TIMESTAMP_X"`
	DateCreate string `json:"DATE_CREATE"`
	CreatedBy  string `json:"CREATED_BY"`
	ModifiedBy string `json:"MODIFIED_BY"`
	Active     string `json:"ACTIVE"`
}
if err := json.Unmarshal(res.Result, &items); err != nil {
	return fmt.Errorf("разбор ответа: %w", err)
}
for _, it := range items {
	fmt.Println(it.ID, it.TimestampX)
}
```

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