Box actions
Reference for the Box actions: the Box connection, each action id, the daily file sync, download and PDF limits, outputs and an example.
The Box block finds, reads and organises files and folders in Box, and manages enterprise users. For the plain-language guide, see Box.
When to use it
Use it for a daily document sync: list the files changed since the last run, download each one or read its PDF pages, and hand the result to the next step. There is no Box trigger and no upload action.
Connection
- Provider id:
box. Box OAuth. - The block sees only what the Box user behind the connection can see.
listUsersandcreateUserneed an enterprise admin connection. - Pin an account with
config.connection. Without it, the step uses the company's default Box connection.
Actions
| Action id | Studio label | What it does |
|---|---|---|
box.copyFile | Copy File | Copy a file into a folder. |
box.copyFolder | Copy Folder | Copy a folder into a folder. |
box.createFolder | Create Folder | Create a folder. |
box.createUser | Create User | Create a managed user in the enterprise; requires an admin connection with Manage users. |
box.deleteFile | Delete File | Move a file to the trash. |
box.deleteFolder | Delete Folder | Move a folder to the trash. Box refuses a non-empty folder unless recursive is true. |
box.getCurrentUser | Get Current User | Get the Box user the connection authenticates as. |
box.getFile | Get File | Get a file’s details. |
box.getFolder | Get Folder | Get a folder’s details, including its first 100 items. |
box.getUser | Get User | Get a user in the enterprise. |
box.listFolderItems | List Folder Items | List one page of a folder’s items. Use totalCount with offset to page. |
box.listUsers | List Users | List users in the enterprise; requires an admin connection. |
box.search | Search | Search files, folders, and web links the connection can see. New or changed content can take about 10 minutes to appear. |
box.updateFile | Update File | Rename a file, change its description, or move it to another folder. |
box.updateFolder | Update Folder | Rename a folder, change its description, or move it to another folder. |
box.listFilesUpdatedSince | List Files Updated Since | List files changed in the last hoursBack hours (default 24) or since a date, across every page. |
box.downloadFile | Download File | Download a file as base64 (up to 3 MiB), or save it to workspace files with persistToFolder (up to 96 MiB). |
box.readPdfPages | Read PDF Pages | Read the text of chosen pages of a PDF stored in Box. |
Settings
| Field | Studio label | Type | Used by | Required for |
|---|---|---|---|---|
connection | Box Account | string (connection id) | All | Optional. Without it the step uses the company default connection for this system |
fileId | File Id | string | copyFile, deleteFile, getFile, updateFile, downloadFile, readPdfPages | copyFile, deleteFile, getFile, updateFile, downloadFile, readPdfPages |
parentId | Parent Id | string | copyFile, copyFolder, createFolder, updateFile, updateFolder | copyFile, copyFolder, createFolder |
name | Name | string | copyFile, copyFolder, createFolder, createUser, updateFile, updateFolder | createFolder, createUser |
folderId | Folder Id | string | copyFolder, deleteFolder, getFolder, listFolderItems, updateFolder | copyFolder, deleteFolder, getFolder, listFolderItems, updateFolder |
login | Login | string | createUser | |
role | Role | string | createUser | |
isPlatformAccessOnly | Is Platform Access Only | boolean | createUser | |
recursive | Recursive | boolean | deleteFolder | |
userId | User Id | string | getUser | getUser |
type | Type | string | listFolderItems, search | |
sort | Sort | string | listFolderItems | |
direction | Direction | string | listFolderItems | |
limit | Limit | number | listFolderItems, listUsers, search | |
offset | Offset | number | listFolderItems, listUsers, search | |
filterTerm | Filter Term | string | listUsers | |
userType | User Type | string | listUsers | |
query | Query | string | search, listFilesUpdatedSince | search |
ancestorFolderIds | Ancestor Folder Ids | string | search, listFilesUpdatedSince | |
fileExtensions | File Extensions | string | search, listFilesUpdatedSince | |
description | Description | string | updateFile, updateFolder | |
hoursBack | Hours Back | number | listFilesUpdatedSince | |
since | Since | string | listFilesUpdatedSince | |
persistToFolder | Persist To Folder | string | downloadFile | |
pages | Pages | string | readPdfPages | |
firstPages | First Pages | number | readPdfPages | |
lastPages | Last Pages | number | readPdfPages |
Folder id 0 is the root folder.
List Files Updated Since
- Needs
queryorfileExtensions, because Box search needs a query. With onlyfileExtensions(for examplepdf,xlsx), the query is the extensions joined withOR. - The window starts at
since(ISO 8601) orhoursBackhours ago (default 24), minus 10 minutes for Box's search index lag. A file near the boundary can appear in two runs; de-duplicate byidandmodified_at. - It pages through every result, newest first, 200 at a time. More than 10,000 matches fails the step; narrow with
ancestorFolderIds,fileExtensionsorquery. - Each file carries
id,type,name,size,extension,created_at,modified_at,parentandpath_collection.
Download File
- Without
persistToFolder, the file must be 3 MiB or smaller and comes back as base64contentwithname,sizeandmimeType. - With
persistToFolder(a folder path in Files), the file can be up to 96 MiB. It is saved as<fileId>-<name>and the step returnsworkspaceFileId,filePathandpersisted: truewith no content. PassworkspaceFileIdasfileIdto the PDF block or the Workspace Files block. - A file Box has not finished processing fails with "not ready to download yet"; retry later.
Read PDF Pages
- Fetches only the byte ranges the selected pages need, up to 96 MiB in total.
pagesis 1-based, such as1-2, 14.firstPagesandlastPagestake pages from the front and end. Empty reads the whole document, up to 500 pages.- Scanned image-only pages return empty text.
Paging and filters
listFolderItems,listUsersandsearchtakelimitandoffset.listFolderItemsreturnsentries,totalCountandoffset;type(file,folderorweb_link) filters the returned page.deleteFileanddeleteFoldermove items to the trash.deleteFolderrefuses a non-empty folder unlessrecursiveis true.
Output
listFilesUpdatedSincereturnssince,countandfiles.downloadFilereturnsfileId,name,size,mimeTypeand eithercontentorworkspaceFileIdandfilePath.readPdfPagesreturnsfileId,name,size,bytesRead,pages(text of each selected page),text(all of it joined),pageCount,pagesReadandfileName.- The other actions return the Box API object.
Read fields with {{steps.<stepId>.<path>}}, for example {{steps.new_invoices.files}}.
Example
Every morning, list the PDFs changed in the invoices folder in the last day, then save the newest one to Files so a PDF step can read it.
{
"name": "Read new Box invoices",
"trigger": { "type": "schedule", "cron": "0 7 * * *", "timezone": "America/Los_Angeles" },
"steps": [
{
"id": "new_invoices",
"type": "action",
"name": "List new invoice PDFs",
"action": "box.listFilesUpdatedSince",
"config": {
"fileExtensions": "pdf",
"ancestorFolderIds": "123456789",
"hoursBack": 24
}
},
{
"id": "save_invoice",
"type": "action",
"name": "Save the newest invoice to Files",
"action": "box.downloadFile",
"config": {
"fileId": "{{steps.new_invoices.files.0.id}}",
"persistToFolder": "box-invoices"
}
}
]
}Live catalog
GET /api/v1/blocks/boxreturns the actions and fields.GET /api/v1/blocks/box/actions/<operation>/examplesreturns stored examples where they exist.
Errors and limits
downloadFilewaits up to 5 minutes for the file content.- A missing required field fails the step before Box is called. Box errors fail the step with Box's message.
Avalara actions
Reference for the Avalara actions: the connection type, each action and what it does, its inputs and outputs, and the live catalog call.
DocuSign actions
Reference for the DocuSign actions: the sign-in connection, each action id, the fields each executor reads including accountId, outputs and an example.
Loopfour