Box Component
Manage files stored in Box
Component key: boxDescription
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.
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
Webhook
Receive and validate webhook requests from Box for webhooks you configure. | key: webhook
Data Sources
Select File or Folder
Select file or folder from Box account base path | key: selectContent | type: picklist
Actions
Add Shared Link to File
Adds a shared link to a file | key: addSharedLinkToFile
Add Shared Link to Folder
Adds a shared link to a folder | key: addSharedLinkToFolder
Copy Object
Copy a Folder or File from one path to another | key: copyObject
{
"data": [
{
"id": "exampleId",
"type": "folder",
"name": "example"
}
]
}
Create Folder
Create a Folder at the specified path | key: createFolder
{
"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
{
"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
{
"data": {}
}
Download File
Download the file at the specified path | key: downloadFile
{
"data": {
"type": "Buffer",
"data": [
101,
120,
97,
109,
112,
108,
101
]
},
"contentType": "application/octet"
}
Find File For Shared Link
Returns the file represented by a shared link | key: findFileForSharedLink
{
"data": {
"type": "file",
"id": "exampleId",
"name": "example"
}
}
Find Folder For Shared Link
Returns the folder represented by a shared link | key: findFolderForSharedLink
{
"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
{
"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
{
"data": "example.com/files/file.txt"
}
Get Shared Link For File
Gets the shared link for a file | key: getSharedLinkForFile
{
"data": {
"sharedLink": "https://app.box.com/s/abbvr71aw8a4gb7u2541hlv45l806u5h"
}
}
Get Shared Link For Folder
Gets the shared link for a folder | key: getSharedLinkForFolder
{
"data": {
"sharedLink": "https://app.box.com/s/abbvr71aw8a4gb7u2541hlv45l806u5h"
}
}
List Folder
List Folder contents at the specified path | key: listFolder
{
"data": [
{
"id": "exampleId",
"type": "folder",
"name": "example"
}
]
}
List Webhooks
List all webhooks configured in Box, including those for other integrations | key: listWebhooks
{
"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
{
"data": [
{
"id": "exampleId",
"type": "folder",
"name": "example"
}
]
}
Path Details
Get detailed information about folders/files in the specified path | key: pathDetails
{
"data": [
{
"id": "exampleId",
"type": "file",
"name": "example"
}
]
}
Raw Request
Send raw HTTP request to Box | key: rawRequest
Remove Shared Link from File
Removes a shared link from a file | key: removeSharedLinkFromFile
Remove Shared Link from Folder
Removes a shared link from a folder | key: removeSharedLinkFromFolder
Update Shared Link on File
Updates a shared link on a file | key: updateSharedLinkToFile
Update Shared Link on Folder
Updates a shared link on a folder | key: updateSharedLinkOnFolder
Upload File
Upload a file to the specified path | key: uploadFile
{
"data": [
{
"id": "exampleId",
"type": "folder",
"name": "example"
}
]
}