Procedures

Automation procedures in the Box BDK Book.

to create a (folder) in another folder

Creates a new empty folder within the specified parent folder.

Input Concepts

Concept
Description
Type
Required
Default Value

folder name

The name for the new folder.

text

Yes

(no default)

A FolderReference for the parent folder.

box folder reference or box item base

Yes

(no default)

fields

A list of attributes to include in the response.

text

No

(no default)

Output Concepts

Concept
Description
Type

A FolderReference object for the newly created folder.

box folder reference or box item base

Examples

retrieve the root folder reference
use the above as the parent folder
create a folder in the parent folder

to delete an item and get an item reference

Deletes a file or folder by moving it to the trash. For folders, this is recursive.

Input Concepts

Concept
Description
Type
Required
Default Value

item

A FileReference or FolderReference object for the item to delete.

box file reference or box folder reference or box item base or box item base

Yes

(no default)

Output Concepts

Concept
Description
Type

item reference

The reference of the item targeted for deletion.

box file reference or box folder reference or box item base or box item base

Examples

retrieve the root folder reference
list the items in the folder
use the above as the item
delete the item
retrieve the root folder reference
list the items in the folder
get the first item
use the above as the item
delete the item

to download a file

Downloads the content of a file.

Input Concepts

Concept
Description
Type
Required
Default Value

A FileReference for the file to download.

box file reference or box item base

Yes

(no default)

version

The specific version ID of the file to download (optional).

text

No

(no default)

Output Concepts

Concept
Description
Type

answer

An IO[bytes] object containing the file content.

file

Examples

retrieve the root folder reference
list the items in the folder
use the above as the file
download the file

to list (items) in a folder

Retrieves a page of item references from the specified folder.

Input Concepts

Concept
Description
Type
Required
Default Value

A FolderReference object for the folder whose items are to be listed.

box folder reference or box item base

Yes

(no default)

fields

A comma-separated list of attributes to include in the response for each item.

text

No

(no default)

usemarker

Specifies whether to use marker-based pagination.

boolean

No

(no default)

marker

Defines the position marker at which to begin returning results (for marker-based pagination).

text

No

(no default)

Output Concepts

Concept
Description
Type

items

A list of item references (FileReference, FolderReference, WebLinkMini).

box file reference or box folder reference or box item base or box item base or box item base or box web link mini

Examples

retrieve the root folder reference
use the above as the folder
list the items in the folder

to retrieve the (root folder reference)

Retrieves a reference to the root folder.

Input Concepts

Concept
Description
Type
Required
Default Value

fields

A list of attributes to include in the response for the root folder reference.

text

No

(no default)

Output Concepts

Concept
Description
Type

A FolderReference object representing the root folder.

box folder reference or box item base

Examples

retrieve the root folder reference
retrieve the root folder reference
... the fields are name, id

to upload a file and get a file reference

Uploads a file to Box. For files over 50MB, consider chunked upload APIs.

Input Concepts

Concept
Description
Type
Required
Default Value

file

The content of the file as a byte stream.

file

Yes

(no default)

file name

The name the file should have in Box.

text

Yes

(no default)

A FolderReference for the parent folder.

box folder reference or box item base

Yes

(no default)

content created at

The RFC3339 timestamp of when the content was created.

text

No

(no default)

content modified at

The RFC3339 timestamp of when the content was last modified.

text

No

(no default)

Output Concepts

Concept
Description
Type

A FileReference object for the uploaded file.

box file reference or box item base

Examples

...
use the above as the file
retrieve the root folder reference
use the above as the parent folder
upload the file to the parent folder

Last updated

Was this helpful?