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.

Authorization Notes#

Box can use OAuth 2.0 for API authentication, or you can supply an API key. Information about generating Box OAuth2 Tokens can be found on their developer documentation site.

Actions#

Copy Object#

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

InputKeyNotesExample

From Path

string
/ Required
fromPathThis represents the source files's path. Include a leading //path/to/source/file.txt

To Path

string
/ Required
toPathThis represents the destination files's path. Include a leading //path/to/destination/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

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

Create Folder#

Create a Folder at the specified path | key: createFolder

InputKeyNotesExample

Path

string
/ Required
pathThis represents the files's path. Include a leading //path/to/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

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

Delete Object#

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

InputKeyNotesExample

Path

string
/ Required
pathThis represents the files's path. Include a leading //path/to/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri


Download File#

Download the file at the specified path | key: downloadFile

InputKeyNotesExample

Path

string
/ Required
pathThis represents the files's path. Include a leading //path/to/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

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

Get File Download URL#

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

InputKeyNotesExample

Path

string
/ Required
pathThis represents the files's path. Include a leading //path/to/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

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

List Folder#

List Folder contents at the specified path | key: listFolder

InputKeyNotesExample

Path

string
/ Required
pathThis represents the files's path. Include a leading //path/to/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

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

Move Object#

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

InputKeyNotesExample

From Path

string
/ Required
fromPathThis represents the source files's path. Include a leading //path/to/source/file.txt

To Path

string
/ Required
toPathThis represents the destination files's path. Include a leading //path/to/destination/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

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

Path Details#

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

InputKeyNotesExample

Path

string
/ Required
pathThis represents the files's path. Include a leading //path/to/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

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

Upload File#

Upload a file to the specified path | key: uploadFile

InputKeyNotesExample

File Contents

data
/ Required
fileContentsThe contents to write to a file. This can be a string of text, it can be binary data (like an image or PDF) that was generated in a previous step.My File Contents

Path

string
/ Required
pathThis represents the files's path. Include a leading //path/to/file.txt

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Keyapi_keyAPI authorization based on an API key

API Key |  api_key

OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

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