disk.storage.getChildren
Получить список файлов и папок в корне хранилища
Описание
Метод disk.storage.getChildren возвращает список файлов и папок, которые находятся в корне хранилища.
Возвращаются только те файлы и папки, к которым у пользователя есть право «Чтение»
Параметры
id
integer
обязательный
Идентификатор хранилища.
Идентификатор можно получить с помощью метода disk.storage.getList
filter
array
необязательный
Массив формата:
{
field_1: value_1,
field_2: value_2,
...,
field_n: value_n,
}
где:
- field_n — название поля, по которому будет произведена фильтрация
- value_n — значение фильтра
К ключам field_n можно добавить префикс, уточняющий работу фильтра.
Возможные значения префикса:
- >= — больше либо равно
- > — больше
- <= — меньше либо равно
- < — меньше
- @ — IN, в качестве значения передается массив
- !@ — NOT IN, в качестве значения передается массив
- % — LIKE, поиск по подстроке. Символ % в значении фильтра передавать не нужно. Поиск ищет подстроку в любой позиции строки
- =% — LIKE, поиск по подстроке. Символ % нужно передавать в значении. Примеры:
- "мол%" — ищет значения, начинающиеся с «мол»
- "%мол" — ищет значения, заканчивающиеся на «мол»
- "%мол%" — ищет значения, где «мол» может быть в любой позиции
- %= — LIKE (аналогично =%)
- = — равно, точное совпадение (используется по умолчанию)
- != — не равно
- ! — не равно
Список доступных для фильтрации полей можно узнать с помощью метода disk.folder.getFields
order
array
необязательный
Массив формата:
{
field_1: value_1,
field_2: value_2,
...,
field_n: value_n,
}
где:
- field_n — название поля, по которому будет произведена сортировка
- value_n — значение типа string, равное:
- ASC — сортировка по возрастанию
- DESC — сортировка по убыванию
Список доступных для сортировки полей можно узнать с помощью метода disk.folder.getFields
start
integer
необязательный
Параметр используется для управления постраничной навигацией.
Размер страницы результатов всегда статичный — 50 записей.
Чтобы выбрать вторую страницу результатов, необходимо передавать значение 50. Чтобы выбрать третью страницу результатов — значение 100 и так далее.
Формула расчета значения параметра start:
start = (N - 1) * 50, где N — номер нужной страницы
Примеры запроса
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":1357,"filter":{"NAME":"%Папка%"},"order":{"NAME":"DESC"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/disk.storage.getChildren
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":1357,"filter":{"NAME":"%Папка%"},"order":{"NAME":"DESC"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/disk.storage.getChildren
// 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 StorageChildItem returned in result[]
type StorageChildItem = {
ID: string
NAME: string
CODE: string | null
STORAGE_ID: string
TYPE: string
REAL_OBJECT_ID: string
PARENT_ID: string
DELETED_TYPE: string
CREATE_TIME: ISODate | null
UPDATE_TIME: ISODate | null
DELETE_TIME: ISODate | null
CREATED_BY: string
UPDATED_BY: string
DELETED_BY: string | null
DETAIL_URL: string
}
try {
// disk.storage.getChildren 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<StorageChildItem[]>({
method: 'disk.storage.getChildren',
params: {
id: 1357,
filter: {
NAME: '%Folder%',
},
order: {
NAME: 'DESC',
},
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('Items found:', result.length, result[0]?.NAME)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- 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 getStorageChildren() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
// disk.storage.getChildren 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: 'disk.storage.getChildren',
params: {
id: 1357,
filter: {
NAME: '%Folder%',
},
order: {
NAME: 'DESC',
},
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('Items found:', result.length, result[0]?.NAME)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getStorageChildren)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.disk.storage.getchildren(
bitrix_id=1357,
filter={
"NAME": "%Папка%",
},
order={
"NAME": "DESC",
},
).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}")
try {
$response = $b24Service
->core
->call(
'disk.storage.getChildren',
[
'id' => 1357,
'filter' => [
'NAME' => '%Папка%'
],
'order' => [
'NAME' => 'DESC'
]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error retrieving children: ' . $e->getMessage();
}
BX24.callMethod(
"disk.storage.getChildren",
{
id: 1357,
filter: {
NAME: '%Папка%'
},
order: {
NAME: 'DESC'
}
},
function (result)
{
if (result.error())
console.error(result.error());
else
console.dir(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'disk.storage.getChildren',
[
'id' => 1357,
'filter' => [
'NAME' => '%Папка%'
],
'order' => [
'NAME' => 'DESC'
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "disk.storage.getChildren", b24.Params{
"id": 1357,
"filter": b24.Params{
"NAME": "%Папка%",
},
"order": b24.Params{
"NAME": "DESC",
},
})
if err != nil {
return fmt.Errorf("disk.storage.getChildren: %w", err)
}
var items []struct {
ID b24.ID `json:"ID"`
Name string `json:"NAME"`
StorageID b24.ID `json:"STORAGE_ID"`
Type string `json:"TYPE"`
RealObjectID b24.ID `json:"REAL_OBJECT_ID"`
ParentID b24.ID `json:"PARENT_ID"`
}
if err := json.Unmarshal(res.Result, &items); err != nil {
return fmt.Errorf("разбор ответа: %w", err)
}
for _, it := range items {
fmt.Println(it.ID, it.Name)
}
Ответ
HTTP-статус: 200
{
"result": [
{
"ID": "8960",
"NAME": "Папка в папке",
"CODE": null,
"STORAGE_ID": "1357",
"TYPE": "folder",
"REAL_OBJECT_ID": "8960",
"PARENT_ID": "8875",
"DELETED_TYPE": "0",
"CREATE_TIME": "2026-01-14T15:01:14+03:00",
"UPDATE_TIME": "2026-01-14T15:01:14+03:00",
"DELETE_TIME": null,
"CREATED_BY": "1269",
"UPDATED_BY": "1269",
"DELETED_BY": "0",
"DETAIL_URL": "https://test.bitrix24.ru/company/personal/user/1269/disk/path/Папка в папке"
},
{
"ID": "8907",
"NAME": "Папка",
"CODE": null,
"STORAGE_ID": "1357",
"TYPE": "folder",
"REAL_OBJECT_ID": "8907",
"PARENT_ID": "8875",
"DELETED_TYPE": "0",
"CREATE_TIME": "2025-12-30T14:16:49+03:00",
"UPDATE_TIME": "2026-01-21T13:53:51+03:00",
"DELETE_TIME": null,
"CREATED_BY": "1269",
"UPDATED_BY": "1269",
"DELETED_BY": "0",
"DETAIL_URL": "https://test.bitrix24.ru/company/personal/user/1269/disk/path/Папка"
},
{
"ID": "9023",
"NAME": "Новая папка",
"CODE": null,
"STORAGE_ID": "1357",
"TYPE": "folder",
"REAL_OBJECT_ID": "9023",
"PARENT_ID": "8875",
"DELETED_TYPE": "0",
"CREATE_TIME": "2026-01-26T13:30:15+03:00",
"UPDATE_TIME": "2026-01-26T13:30:15+03:00",
"DELETE_TIME": null,
"CREATED_BY": "1269",
"UPDATED_BY": "1269",
"DELETED_BY": null,
"DETAIL_URL": "https://test.bitrix24.ru/company/personal/user/1269/disk/path/Новая папка"
}
],
"total": 3,
"time": {
"start": 1769539624,
"finish": 1769539624.498846,
"duration": 0.49884605407714844,
"processing": 0,
"date_start": "2026-01-26T14:47:04+03:00",
"date_finish": "2026-01-26T14:47:04+03:00",
"operating_reset_at": 1769540224,
"operating": 0
}
}
Возвращаемые данные
result
array
Список файлов и папок с описанием полей.
Пустой массив означает, что у пользователя нет прав на просмотр файлов и папок, находящихся в корне хранилища
ID
integer
Идентификатор файла/папки
NAME
string
Имя файла/папки
CODE
string
Символьный код файла/папки
STORAGE_ID
integer
Идентификатор хранилища, в котором находится файл/папка
TYPE
enum
Тип объекта
REAL_OBJECT_ID
integer
Идентификатор объекта
PARENT_ID
integer
Идентификатор родительской папки
DELETED_TYPE
enum
Статус удаления объекта. Возможные значения:
- 0 — не удален
- 3 — в корзине
- 4 — удален вместе с родительской папкой
GLOBAL_CONTENT_VERSION
integer
Инкрементальный счетчик версии файла
FILE_ID
integer
Внутреннее значение идентификатора файла
SIZE
integer
Размер файла в байтах
CREATE_TIME
datetime
Дата и время создания файла/папки
UPDATE_TIME
datetime
Дата и время последнего обновления файла/папки
DELETE_TIME
datetime
Дата и время переноса файла/папки в корзину
CREATED_BY
integer
Идентификатор пользователя, создавшего файл/папку
UPDATED_BY
integer
Идентификатор пользователя, внесшего последнее изменение
DELETED_BY
integer
Идентификатор пользователя, удалившего файл/папку
DOWNLOAD_URL
string
Ссылка для скачивания файла
DETAIL_URL
string
Ссылка для открытия файла/папки в интерфейсе
total
integer
Общее количество файлов и папок
time
time
Информация о времени выполнения запроса
Обработка ошибок
HTTP-статус: 400
{
"error":"ERROR_ARGUMENT",
"error_description":"Invalid value of parameter {Parameter #0}"
}
| Код | Описание | Значение |
|---|---|---|
ERROR_ARGUMENT |
Invalid value of parameter {Parameter #0} | Не указан обязательный параметр id |
ERROR_NOT_FOUND |
Could not find entity with id X |
Хранилище с указанным id не найдено |

