Skip to content

Box connects with OAuth 2.0 through Truto's Box app or your own.

Install the Box integration

Install Box from Available integrations in each environment you connect accounts from.

Use your own Box OAuth app

Truto connects Box accounts through its own OAuth app, so this step is optional unless you want webhooks (see Receive webhooks) or the Box file picker on your site, which needs your site's origin listed on the Box app. To show your own app on the consent screen instead:

  1. Create an OAuth app in Box and add https://api.truto.one/connect/box/callback as its redirect URL. If you use a redirect URL on your own domain, add that URL instead.
  2. Enter the app's Client ID and Client Secret on the installed Box integration. See Overriding OAuth credentials.

By default, Truto asks Box for these scopes. The Connect UI lists them under Permissions required, and you can change them when you override the OAuth credentials.

  • manage_enterprise_properties
  • manage_managed_users
  • manage_groups
  • root_readwrite
  • manage_webhook

Enable the same scopes on your app. If your app allows fewer, change the list under Use your own OAuth settings → Scopes on the installed integration's Configuration tab to match.

Connect a Box account

  1. In Integrated Accounts, click Connect Account. Click Connect Account
  2. Enter a Tenant ID (your customer's ID; Truto creates the tenant if it is new), or pick one under Existing tenant (optional). Check the Environment and the Region (where Truto places the account; Western North America by default). To open the link straight on Box, pick it under Advanced settings → Integration (optional). Click Get connection link. Get connection link
  3. Click the open-in-new-tab button, or click Copy and send the link to your customer so they connect their own Box account. The link works for 7 days, until an account is connected with it. Share connection link
  4. Click Get Started if it shows, then select Box. Select Box
  5. Sign in to Box and allow access to Truto.
  6. Close the tab when you see Connection successful. The new account appears under Integrated Accounts. Click its Account ID to see its details and make API calls.

Receive webhooks

Box can send file and folder changes to Truto, which passes them on as unified record:* events on file-storage/drive-items.

Box signs each webhook with the signature keys of the Box app the webhook belongs to, so the accounts must connect through your own Box app.

  1. Install the File Storage Unified API in the environment. Truto turns Box events into record:* events only through it; without it, events are dropped.
  2. Subscribe a Truto webhook to record:created, record:updated and record:deleted, or all. See Creating a webhook.
  3. In the Box Developer Console, open your app, go to the Webhooks tab, click Manage signature keys and generate a primary key.
  4. Save the primary key as a webhook_secret variable on the integrated account: Integrated Accounts → the account → Details → Variables → Edit variables (Add variables when it has none). Truto checks every event's box-signature-primary header against it and rejects events that don't match.
  5. Create the webhook through the Proxy API resource webhooks (POST /2.0/webhooks in Box) for the file or folder to watch, with the address https://api.truto.one/integrated-account-webhook/<integrated_account_id> and the triggers below.
Box trigger Truto event
FILE.UPLOADED, FILE.COPIED, FOLDER.CREATED, FOLDER.COPIED record:created
FILE.RESTORED, FILE.MOVED, FILE.RENAMED, FOLDER.RENAMED, FOLDER.RESTORED, FOLDER.MOVED record:updated
FILE.TRASHED, FILE.DELETED, FOLDER.TRASHED, FOLDER.DELETED record:deleted

See Receiving vendor webhooks.