v1.2.0

Disk — storages, folders, files

List storages and folder children, create subfolders, inspect files. File upload (multipart) is intentionally out of scope.

What it does

Touches every read/write operation Bitrix24 Disk supports without multipart: disk.storage.getlist, disk.folder.getchildren (paged via actions.v2.callList.make), disk.folder.addsubfolder, disk.file.get. Includes an actions.v2.batch.make example combining storages and root-folder listing in one round-trip.

Stack

Node.js 18+. No external dependencies.

Environment

export B24_HOOK='https://your.bitrix24.com/rest/1/secret'

Webhook scope required: the incoming webhook must have the disk scope enabled. Bitrix24 portal → Developer resources → Inbound webhooks → edit → tick Диск (disk). Without it all Disk API calls return insufficient_scope (HTTP 401).

Run

npx tsx 05-disk-files.ts

Source

skills/b24jssdk-recipes/examples/05-disk-files.ts.

Notes

  • Uploading a binary requires disk.folder.uploadfile with multipart/form-data. The SDK can do this via the underlying Http transport, but it isn't a drop-in actions.v2.call.make invocation — that recipe is on the suggestion list.
  • Disk methods use classic uppercase fields: ID, NAME, PARENT_ID, ROOT_OBJECT_ID. There is no v3 Disk API.
  • disk.folder.getchildren is paged — always go through actions.v2.callList.make (or actions.v2.fetchList.make for large folders), not a single actions.v2.call.make.