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.uploadfilewithmultipart/form-data. The SDK can do this via the underlyingHttptransport, but it isn't a drop-inactions.v2.call.makeinvocation — 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.getchildrenis paged — always go throughactions.v2.callList.make(oractions.v2.fetchList.makefor large folders), not a singleactions.v2.call.make.