HELIOS DOCS

Box

The Box integration lets Helios agents work with files and folders in Box through its REST API, and run agents automatically on Box webhook events in a folder you choose.

What your agents can do

Agents call Box API 2.0 with the connected account's credentials. Access depends on the app's scopes and the account's permissions and Box plan.

  • Search files and folders by name and content, read or download files, and download folders as zip archives
  • Upload files and new file versions to a folder
  • Comment on files, reply to comments, and assign tasks
  • Create shared links and manage collaborators
  • Create folders, and rename, copy, and move files and folders
  • Send Box Sign requests, ask Box AI about files, and add or change metadata
  • Work with Box Hubs, Doc Gen, Archives, Shield lists, and Box Automate

The agent's API tool reaches api.box.com, the upload host upload.box.com, and the zip download host dl.boxcloud.com. It sends or receives files up to 16 MB in one call.

Authentication

MethodTypeDescription
Box Client Credentials GrantOAuth 2.0 (client credentials)A Server app that acts as its service account or as a managed user
Your own Box OAuth appOAuth 2.0A User app that acts as the person who approves it

Both methods use a Platform App that you create in the Box Developer Console. Any Box account with access to the Developer Console can create one, including a free developer account. Helios doesn't ask for scopes with either method. Box gives the token every scope selected on the app, so the app's scopes decide what agents can do. Select the scopes your agents need on the app's Configuration tab under Application Scopes:

ScopeOAuth scopeWhat it unlocksNeeds
Read all files and folders stored in Boxroot_readonlyReading file and folder metadata and comments
Read and write all files and folders stored in Boxroot_readwriteDownloading files and folders, uploading files, and changing files, folders, comments, tasks, shared links, and collaborators
Manage webhooksmanage_webhookRegistering the webhook for triggers
Manage signature requestssign_requests.readwriteSending, resending, and canceling Box Sign requestsA Business plan or higher
Manage AIai.readwriteAsking Box AI about files and extracting data with itA Box admin turns on the Box AI API
Manage Box Relaymanage_triggersListing workflows and starting workflows that are started by hand
Manage usersmanage_managed_users, manage_app_usersManaging the enterprise's usersAn admin or co-admin
Manage groupsmanage_groupsManaging groups and their membersAn admin or co-admin
Manage enterprise propertiesmanage_enterprise_propertiesReading the enterprise event stream, reports, and settingsAn admin or co-admin
Manage retention policiesmanage_data_retentionReading and creating retention policiesBox Governance and Global Content Manager
Manage Legal Holdsmanage_legal_holdsReading and creating legal hold policiesBox Governance and a support request
Global Content Managerenterprise_contentReading content across the enterprise that the user doesn't ownA support request on a paid plan
  • An admin or co-admin: with a User app, these scopes only work for an admin or co-admin who approves the app. With a Server app, set App Access Level to App + Enterprise Access.
  • A support request: Box adds Legal Holds and Global Content Manager to an app only after you ask its support team, and only on a paid plan. Ask for Global Content Manager only if you need it. Box warns that it changes how other calls behave, and writes then need the as-user header.

See Integration authentication for how credentials are stored and injected.

Box Client Credentials Grant

Box shows the client secret only to accounts with multi-factor authentication turned on.

  1. In the Developer Console, select New App, then Server. If Box shows Select Method, leave Client Credentials Grant selected. Select Create.

  2. On the Configuration tab, select the scopes above. To act as a managed user instead of the app's service account, or to use the admin scopes, set App Access Level to App + Enterprise Access. To act as a managed user, also turn on Generate User Access Tokens. Save the changes.

  3. Authorize the app:

    • Free developer account: Box authorizes the app when you create it.
    • Enterprise admin or co-admin: authorize it from the Configuration tab.
    • Other enterprise users: the Configuration tab asks you to submit the app for approval. Your admin gets an email.

    Box needs the app authorized again after any change to its scopes or access level.

  4. Find your enterprise ID. Select your account icon at the top right of the Developer Console and choose Copy Enterprise ID.

  5. In Helios, choose Box Client Credentials Grant. Enter the Client ID and Client Secret from the Configuration tab, and the Enterprise ID.

  6. Optional: to act as a managed user, enter their ID in User ID. Leave it empty to act as the service account. A user finds their own ID under Account Settings → Account → Account Details as the Account ID.

  7. Optional: for triggers, fill in Folder ID and Primary Signature Key. See Triggers.

  8. Save.

Helios gets a new access token from Box when the old one expires, so there is nothing to renew. Helios keeps each token for up to an hour, so a scope change can take that long to apply. If you change the client secret in Box, enter the new one in Helios through Manage.

The service account starts with no files. To let agents work in a folder, invite the service account's email address, shown on the app's App Details tab, as a collaborator on that folder.

Your own Box OAuth app

  1. In the Developer Console, select New App, then User, and select Create.

  2. On the Configuration tab, add this URL under OAuth 2.0 Redirect URI, select the scopes above, and save the changes:

    https://api.heliosapp.com/integrations/box/oauth_callback
  3. In an enterprise, an admin may need to enable the app first. Submit it from the app's Enablement tab, which emails your primary admin.

  4. In Helios, choose Your own Box OAuth app. Enter the Client ID and Client Secret from the Configuration tab.

  5. Optional: for triggers, fill in Folder ID and Primary Signature Key now. See Triggers.

  6. Save, then approve access in Box.

Box replaces the refresh token each time Helios uses it, and a refresh token expires after 60 days. Helios refreshes the token every week, so an idle connection stays signed in.

If you change the client secret in Box, enter the new one through Manage. After you change the secret or the app's scopes, click Re-connect on the connection and approve again.

Triggers

Box can start a Workflow when something happens in one folder and its subfolders. Helios registers a Box webhook on that folder for every event below when you save the connection, using the Manage webhooks scope. When you delete the connection, Helios attempts to remove the webhook. If removal fails, the connection is still deleted. Open the app's Webhooks tab in the Box Developer Console, find the webhook whose address ends with the deleted connection's ID, and delete that webhook. To turn triggers on, set these on the connection:

  • Folder ID: the folder to watch. It is the number at the end of the folder's URL, such as 123456789 in https://app.box.com/folder/123456789. Box doesn't allow webhooks on the root folder (All Files). Leave the field empty to turn triggers off.
  • Primary Signature Key, and optionally the Secondary Signature Key: on the app's Webhooks tab, click Manage signature keys, then Generate Key.

Watch a folder that the connected user owns. Box only lists webhooks on items that the user owns, and Helios needs that list to find and replace its webhook. With the service account, watch a folder the service account created, or set User ID and watch a folder that user owns.

EventDescriptionFilters
file.uploadedA file was uploaded or moved infile name (pattern)
file.previewedA file was previewedfile name (pattern)
file.downloadedA file was downloadedfile name (pattern)
file.trashedA file was moved to the trashnone
file.deletedA file was permanently deletednone
file.restoredA file was restored from the trashfile name (pattern)
file.copiedA file was copiedfile name (pattern)
file.movedA file was movedfile name (pattern)
file.lockedA file was lockedfile name (pattern)
file.unlockedA file was unlockedfile name (pattern)
file.renamedA file was renamedfile name (pattern)
folder.createdA folder was createdfolder name (pattern)
folder.renamedA folder was renamedfolder name (pattern)
folder.downloadedA folder was downloadedfolder name (pattern)
folder.restoredA folder was restored from the trashfolder name (pattern)
folder.deletedA folder was permanently deletednone
folder.copiedA folder was copiedfolder name (pattern)
folder.movedA folder was movedfolder name (pattern)
folder.trashedA folder was moved to the trashnone
comment.createdA comment was added to a filenone
comment.updatedA comment was editednone
comment.deletedA comment was deletednone
collaboration.createdA collaborator was invitedfolder name (pattern), role (pattern)
collaboration.acceptedA collaboration invite was acceptedfolder name (pattern), role (pattern)
collaboration.rejectedA collaboration invite was rejectedfolder name (pattern), role (pattern)
collaboration.removedA collaborator was removedfolder name (pattern), role (pattern)
collaboration.updatedA collaborator's role was changedfolder name (pattern), role (pattern)
shared_link.createdA shared link was createdlink access (pattern)
shared_link.updatedA shared link was changedlink access (pattern)
shared_link.deletedA shared link was removedlink access (pattern)
metadata_instance.createdMetadata was addedfile or folder name (pattern)
metadata_instance.updatedMetadata was changedfile or folder name (pattern)
metadata_instance.deletedMetadata was removedfile or folder name (pattern)
task_assignment.createdA task was assignedfile name (pattern)
task_assignment.updatedA task assignment was changedfile name (pattern)
sign_request.signature_requestedA signature was requestedfile name (pattern)
sign_request.signer_signedA signer signedfile name (pattern)
sign_request.completedA sign request was completedfile name (pattern)
sign_request.declinedA sign request was declinedfile name (pattern)
sign_request.expiredA sign request expiredfile name (pattern)
sign_request.signer_email_bouncedA signer's email bouncedfile name (pattern)
sign_request.error_finalizingA signed document could not be finalizedfile name (pattern)
webhook.deletedBox deleted the webhooknone

All filters are optional patterns, and they are case-sensitive. *.pdf matches report.pdf but not REPORT.PDF. Use *.{pdf,PDF} to match both.

  • File name, Folder name, and File or folder name match the item's name, not its path. For collaborations, the folder is the one being shared. For tasks, the file is the one the task is on. For Box Sign events, the file is the PDF that Box Sign makes from the document. Box sends no name for trashed or deleted items, and only the item's ID for comments and shared links, so those events have no name filter.
  • Role matches the collaborator's role, such as editor, viewer, or co-owner. For collaboration.updated, it matches the new role.
  • Link access matches who can open the link: open (anyone with the link), company, or collaborators.

The sign_request events need Box Sign, which Box offers on Business plans and higher.

If Box refuses one of the events when Helios registers the webhook, Helios registers the others. The trigger picker then shows the refused event as unavailable, with the reason. Helios doesn't ask Box again on its own. After you change the app's scopes or your Box plan, save the connection again. When Folder ID is empty, every event shows as unavailable.

Helios accepts a delivery when either signature matches, and rejects deliveries more than ten minutes old. To rotate keys, change one key at a time, in Box and in Helios.

Box retries a failed delivery up to 5 times over an hour. It deletes a webhook when the app is deleted or when all of the webhook's access tokens are revoked. It also deletes a webhook whose last successful delivery was 30 days ago, if more than 14 days passed between that delivery and the latest event. Only these deletions send webhook.deleted. Deleting the watched folder for good also removes the webhook, without that event. Save the connection again to register the webhook again.

An agent that acts in the watched folder starts more runs. A comment starts comment.created, a new folder starts folder.created, and a moved, renamed, copied, or shared file starts the matching file or shared_link event. Previewing or downloading a file also counts. Say in the prompt which events to ignore, such as comments the agent wrote. See Guarding against events you don't want.

Check that it works

  • The connection: after you save, the connection's status shows Connected. Error means Box rejected the credentials. See Common errors.
  • The webhook: if you own the watched folder, the app's Webhooks tab in the Developer Console lists a webhook whose address ends with the connection's ID.
  • A trigger:
    1. Add file.uploaded to a workflow with no filters.
    2. Upload a file to the watched folder.
    3. Check that a run starts. Then open the connection in Helios and click Webhook events to see the event.

Common errors

What you seeCauseFix
Box did not issue a token: Grant credentials are invalidThe client ID and secret don't match, the app can't act as that user, or the app isn't authorizedCheck both values. For User ID, turn on App + Enterprise Access and Generate User Access Tokens. Then have the app authorized again
An error that includes This app is not authorized by the enterpriseThe app isn't authorized in the enterpriseAuthorize it from the Configuration tab, or ask your admin to approve it
A call fails with 403 and insufficient_scopeThe scope that the call needs isn't selected on the appSelect the scope on the app's Configuration tab and save. For a Server app, have it authorized again. For a User app, click Re-connect
Access token not found. Please complete the OAuth flow first.The approval in Box wasn't finishedOpen the connection and click Re-connect
The connection's status shows ErrorThe OAuth app's access was revoked, or the refresh token expiredClick Re-connect on the connection
Set the folder ID to the number at the end of a Box folder's URL. The root folder cannot be watched.Folder ID isn't a folder number, or it is 0Copy the number from the folder's URL
Add the Box app's primary signature key to use triggers. Helios needs it to check that deliveries come from Box.Folder ID is set without a signature keyGenerate a key on the app's Webhooks tab and enter it
Every event shows Another Box webhook from this app already watches this folder.Another webhook from the same app and user watches the folder, such as one from another Helios connectionWatch another folder, or delete the other webhook on the app's Webhooks tab or remove the other connection. Then save this connection again
An event shows Box did not accept the … trigger for the watched folder.Box refused that event for this app or folderCheck that the app has the scope the event needs, such as Manage signature requests, then save the connection again
An agent says a file is too largeThe agent's API tool sends and receives at most 16 MB in one callLarger uploads can go through an upload session, which sends the file in parts
No run starts after an eventFolder ID is empty, the connected user doesn't own the folder, the signature key in Helios doesn't match Box, Box deleted the webhook, or the filters don't matchCheck the connection's trigger settings and save it again, then test with no filters

Last updated on