Skip to main content

Box Component

Manage files stored in Box

Component key: box

Description

Box is a file sharing platform that allows teams to collaborate and share files with one another. The Box component allows you to create, list, fetch, move, or delete files and folders in a customer's Box account.

A common integration pattern involves listing files in a file store, and performing a series of actions on the array of files that are returned. See our looping over files quickstart for information about how to create a loop over an array of files.

Connections

Box Developer Token

A Developer Token is a short-lived (60-minute) token that you can use for testing purposes. A developer token allows you to use the Box API to access your personal Box account only.

note

When your integration is ready for production, you'll need an OAuth 2.0 connection to authenticate your customers' Box accounts. You can also do your testing with OAuth.

Box OAuth 2.0 Connection

This component authenticates with Box using OAuth 2.0. You will need to create a Box OAuth 2.0 app in order to authorize your integration to access your customers' Box accounts.

You can follow along with Box's OAuth 2.0 setup documentation here. Note:

  • Be sure to select User Authentication (OAuth 2.0) when creating a Custom App
  • Take note of your Client ID and Client Secret - you'll enter those in Prismatic in a moment
  • Under OAuth 2.0 Redirect URI, enter https://oauth2.prismatic.io/callback
  • Under Application Scopes, select Write all files and folders stored in Box
  • Leave CORS Domains blank

When you add a Box step to an integration, a Box OAuth 2.0 connection will be created for you. Enter the Client ID and Client Secret that you noted earlier. You can leave Scopes blank to use the Application Scopes that you set up previously. Or, you can pare down scopes as desired (reference Box's scopes documentation).

Triggers

Box Webhook

Handle and validate webhook requests from Box | key: webhook


Data Sources

Select File or Folder

Select file or folder from Box account base path | key: selectContent | type: picklist


Actions

Adds a shared link to a file | key: addSharedLinkToFile


Adds a shared link to a folder | key: addSharedLinkToFolder


Copy Object

Copy a Folder or File from one path to another | key: copyObject

Output Example Payload

{
"data": [
{
"id": "exampleId",
"type": "folder",
"name": "example"
}
]
}

Create Folder

Create a Folder at the specified path | key: createFolder

Output Example Payload

{
"data": {
"id": "exampleId",
"status": "active",
"name": "Example",
"created_at": "2020-01-01T12:00:00Z",
"description": "Example description.",
"folder": "exampleFolder"
}
}

Create Webhook

Create a webhook to send data from Box to an instance URL | key: createWebhook

Output Example Payload

{
"data": {
"id": "1234",
"type": "webhook",
"target": {
"id": "22222",
"type": "folder"
},
"created_by": {
"type": "user",
"id": "33333",
"name": "Example User",
"login": "user@example.com"
},
"created_at": "2016-05-09T17:41:27-07:00",
"address": "https://example.com/webhook",
"triggers": [
"FILE.DOWNLOADED",
"FILE.UPLOADED"
]
},
"crossFlowState": {
"primarySignatureKey": "3T2eTfOvJbAIRoBpXsXPmq0gn8CmF5Q7"
}
}

Delete Instance Webhooks

Delete all Box webhooks that point to a flow in this instance | key: deleteInstanceWebhooks


Delete Object

Delete a Folder or File at the specified path | key: deleteObject


Delete Webhook

Delete a webhook by ID | key: deleteWebhook

Output Example Payload

{
"data": {}
}

Download File

Download the file at the specified path | key: downloadFile

Output Example Payload

{
"data": {
"type": "Buffer",
"data": [
101,
120,
97,
109,
112,
108,
101
]
},
"contentType": "application/octet"
}

Returns the file represented by a shared link | key: findFileForSharedLink

Output Example Payload

{
"data": {
"type": "file",
"id": "exampleId",
"name": "example"
}
}

Returns the folder represented by a shared link | key: findFolderForSharedLink

Output Example Payload

{
"data": {
"type": "folder",
"id": "exampleId",
"name": "example"
}
}

Get Current User

Get the information and metadata of the user that is currently logged in | key: getCurrentUser

Output Example Payload

{
"data": {
"type": "user",
"id": "33333",
"name": "Example User",
"login": "user@example.com",
"created_at": "2012-03-26T15:43:07-07:00",
"modified_at": "2012-12-12T11:34:29-08:00",
"language": "en",
"space_amount": 5368709120,
"space_used": 2377016,
"max_upload_size": 262144000,
"status": "active",
"job_title": "Employee",
"phone": "5555555555",
"address": "555 Office Drive",
"avatar_url": "https://app.box.com/api/avatar/deprecated"
}
}

Get File Download URL

Get a URL to download the file at the specified path | key: getFileDownloadUrl

Output Example Payload

{
"data": "example.com/files/file.txt"
}

Gets the shared link for a file | key: getSharedLinkForFile

Output Example Payload

{
"data": {
"sharedLink": "https://app.box.com/s/abbvr71aw8a4gb7u2541hlv45l806u5h"
}
}

Gets the shared link for a folder | key: getSharedLinkForFolder

Output Example Payload

{
"data": {
"sharedLink": "https://app.box.com/s/abbvr71aw8a4gb7u2541hlv45l806u5h"
}
}

List Folder

List Folder contents at the specified path | key: listFolder

Output Example Payload

{
"data": [
{
"id": "exampleId",
"type": "folder",
"name": "example"
}
]
}

List Webhooks

List all webhooks configured in Box, including those for other integrations | key: listWebhooks

Output Example Payload

{
"data": {
"next_marker": "ZmlQZS0xLTE%3D",
"entries": [
{
"id": "1234",
"type": "webhook",
"target": {
"id": "22222",
"type": "folder"
}
},
{
"id": "5678",
"type": "webhook",
"target": {
"id": "11111",
"type": "file"
}
}
],
"limit": 2
}
}

Move Object

Move a Folder or File from one path to another | key: moveObject

Output Example Payload

{
"data": [
{
"id": "exampleId",
"type": "folder",
"name": "example"
}
]
}

Path Details

Get detailed information about folders/files in the specified path | key: pathDetails

Output Example Payload

{
"data": [
{
"id": "exampleId",
"type": "file",
"name": "example"
}
]
}

Raw Request

Send a raw HTTP request to Box API | key: rawRequest


Removes a shared link from a file | key: removeSharedLinkFromFile


Removes a shared link from a folder | key: removeSharedLinkFromFolder


Updates a shared link on a file | key: updateSharedLinkToFile


Updates a shared link on a folder | key: updateSharedLinkOnFolder


Upload File

Upload a file to the specified path | key: uploadFile

Output Example Payload

{
"data": [
{
"id": "exampleId",
"type": "folder",
"name": "example"
}
]
}