Entaxy Docs

Box

Since Camel 2.14

Both producer and consumer are supported

The Box component provides access to all of the Box.com APIs accessible using https://github.com/box/box-java-sdk. It allows producing messages to upload and download files, create, edit, and manage folders, etc. It also supports APIs that allow polling for updates to user accounts and even changes to enterprise accounts, etc.

Box.com requires the use of OAuth2.0 for all client application authentication. In order to use camel-box with your account, you’ll need to create a new application within Box.com at https://developer.box.com. The Box application’s client id and secret will allow access to Box APIs which require a current user. A user access token is generated and managed by the API for an end user.

Maven users will need to add the following dependency to their pom.xml for this component:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-box</artifactId>
    <version>${camel-version}</version>
</dependency>

Connection Authentication Types

The Box component supports three different types of authenticated connections.

Standard Authentication

Standard Authentication uses the OAuth 2.0 three-legged authentication process to authenticate its connections with Box.com. This type of authentication enables Box managed users and external users to access, edit, and save their Box content through the Box component.

App Enterprise Authentication

App Enterprise Authentication uses the OAuth 2.0 with JSON Web Tokens (JWT) to authenticate its connections as a Service Account for a Box Application. This type of authentication enables a service account to access, edit, and save the Box content of its Box Application through the Box component.

App User Authentication

App User Authentication uses the OAuth 2.0 with JSON Web Tokens (JWT) to authenticate its connections as an App User for a Box Application. This type of authentication enables app users to access, edit, and save their Box content in its Box Application through the Box component.

Configuring Options

Camel components are configured on two separate levels:

  • component level

  • endpoint level

Configuring Component Options

The component level is the highest level which holds general and common configurations that are inherited by the endpoints. For example a component may have security settings, credentials for authentication, urls for network connection and so forth.

Some components only have a few options, and others may have many. Because components typically have pre configured defaults that are commonly used, then you may often only need to configure a few options on a component; or none at all.

Configuring components can be done with the Component DSL, in a configuration file (application.properties|yaml), or directly with Java code.

Configuring Endpoint Options

Where you find yourself configuring the most is on endpoints, as endpoints often have many options, which allows you to configure what you need the endpoint to do. The options are also categorized into whether the endpoint is used as consumer (from) or as a producer (to), or used for both.

Configuring endpoints is most often done directly in the endpoint URI as path and query parameters. You can also use the Endpoint DSL and DataFormat DSL as a type safe way of configuring endpoints and data formats in Java.

A good practice when configuring options is to use Property Placeholders, which allows to not hardcode urls, port numbers, sensitive information, and other settings. In other words placeholders allows to externalize the configuration from your code, and gives more flexibility and reuse.

The following two sections lists all the options, firstly for the component followed by the endpoint. == Component Options

The Box component supports 19 options, which are listed below.

Name Description Default Type

clientId (common)

Box application client ID.

String

configuration (common)

To use the shared configuration.

BoxConfiguration

enterpriseId (common)

The enterprise ID to use for an App Enterprise.

String

userId (common)

The user ID to use for an App User.

String

bridgeErrorHandler (consumer)

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

boolean

lazyStartProducer (producer)

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

boolean

autowiredEnabled (advanced)

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

boolean

httpParams (advanced)

Custom HTTP params for settings like proxy host.

Map

authenticationType (authentication)

The type of authentication for connection. Types of Authentication: STANDARD_AUTHENTICATION - OAuth 2.0 (3-legged) SERVER_AUTHENTICATION - OAuth 2.0 with JSON Web Tokens.

APP_USER_AUTHENTICATION

String

accessTokenCache (security)

Custom Access Token Cache for storing and retrieving access tokens.

IAccessTokenCache

clientSecret (security)

Box application client secret.

String

encryptionAlgorithm (security)

The type of encryption algorithm for JWT. Supported Algorithms: RSA_SHA_256 RSA_SHA_384 RSA_SHA_512.

Enum values:

  • RSA_SHA_256

  • RSA_SHA_384

  • RSA_SHA_512

RSA_SHA_256

EncryptionAlgorithm

maxCacheEntries (security)

The maximum number of access tokens in cache.

100

int

privateKeyFile (security)

The private key for generating the JWT signature.

String

privateKeyPassword (security)

The password for the private key.

String

publicKeyId (security)

The ID for public key for validating the JWT signature.

String

sslContextParameters (security)

To configure security using SSLContextParameters.

SSLContextParameters

userName (security)

Box user name, MUST be provided.

String

userPassword (security)

Box user password, MUST be provided if authSecureStorage is not set, or returns null on first call.

String

Endpoint Options

The Box endpoint is configured using URI syntax:

box:apiName/methodName

with the following path and query parameters:

Path Parameters (2 parameters)

Name Description Default Type

apiName (common)

Required What kind of operation to perform.

Enum values:

  • COLLABORATIONS

  • COMMENTS

  • EVENT_LOGS

  • FILES

  • FOLDERS

  • GROUPS

  • EVENTS

  • SEARCH

  • TASKS

  • USERS

BoxApiName

methodName (common)

Required What sub operation to use for the selected operation.

String

Query Parameters (19 parameters)

Name Description Default Type

clientId (common)

Box application client ID.

String

enterpriseId (common)

The enterprise ID to use for an App Enterprise.

String

inBody (common)

Sets the name of a parameter to be passed in the exchange In Body.

String

userId (common)

The user ID to use for an App User.

String

exceptionHandler (consumer (advanced))

To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.

ExceptionHandler

exchangePattern (consumer (advanced))

Sets the exchange pattern when the consumer creates an exchange.

Enum values:

  • InOnly

  • InOut

  • InOptionalOut

ExchangePattern

lazyStartProducer (producer (advanced))

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

boolean

httpParams (advanced)

Custom HTTP params for settings like proxy host.

Map

authenticationType (authentication)

The type of authentication for connection. Types of Authentication: STANDARD_AUTHENTICATION - OAuth 2.0 (3-legged) SERVER_AUTHENTICATION - OAuth 2.0 with JSON Web Tokens.

APP_USER_AUTHENTICATION

String

accessTokenCache (security)

Custom Access Token Cache for storing and retrieving access tokens.

IAccessTokenCache

clientSecret (security)

Box application client secret.

String

encryptionAlgorithm (security)

The type of encryption algorithm for JWT. Supported Algorithms: RSA_SHA_256 RSA_SHA_384 RSA_SHA_512.

Enum values:

  • RSA_SHA_256

  • RSA_SHA_384

  • RSA_SHA_512

RSA_SHA_256

EncryptionAlgorithm

maxCacheEntries (security)

The maximum number of access tokens in cache.

100

int

privateKeyFile (security)

The private key for generating the JWT signature.

String

privateKeyPassword (security)

The password for the private key.

String

publicKeyId (security)

The ID for public key for validating the JWT signature.

String

sslContextParameters (security)

To configure security using SSLContextParameters.

SSLContextParameters

userName (security)

Box user name, MUST be provided.

String

userPassword (security)

Box user password, MUST be provided if authSecureStorage is not set, or returns null on first call.

String

API Parameters (10 APIs)

The Box endpoint is an API based component and has additional parameters based on which API name and API method is used. The API name and API method is located in the endpoint URI as the apiName/methodName path parameters:

box:apiName/methodName

There are 10 API names as listed in the table below:

API Name Type Description

collaborations

Producer

Provides operations to manage Box collaborations

comments

Producer

Provides operations to manage Box comments

event-logs

Producer

Provides operations to read Box enterprise (admin) event logs

events

Consumer

Provides operations to manage Box events

files

Producer

Provides operations to manage Box files

folders

Producer

Provides operations to manage Box folders

groups

Producer

Provides operations to manage Box groups

search

Producer

Provides operations to manage Box searches

tasks

Producer

Provides operations to manage Box tasks

users

Producer

Provides operations to manage Box users

Each API is documented in the following sections to come.

API: collaborations

Only producer is supported

The collaborations API is defined in the syntax as follows:

box:collaborations/methodName?[parameters]

The 6 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

addFolderCollaboration

add

Add a collaboration to this folder

addFolderCollaborationByEmail

add

Add a collaboration to this folder

deleteCollaboration

delete

Delete collaboration

getCollaborationInfo

info

Get collaboration information

getFolderCollaborations

collaborations

Get information about all of the collaborations for folder

updateCollaborationInfo

updateInfo

Update collaboration information

Method addFolderCollaboration

Signatures:

  • com.box.sdk.BoxCollaboration addFolderCollaboration(String folderId, com.box.sdk.BoxCollaborator collaborator, com.box.sdk.BoxCollaboration.Role role);

The box/addFolderCollaboration API method has the parameters listed in the table below:

Parameter Description Type

collaborator

`${paramValue.description

''}`

BoxCollaborator

folderId

`${paramValue.description

''}`

String

role

`${paramValue.description

''}`

Role

Method addFolderCollaborationByEmail

Signatures:

  • com.box.sdk.BoxCollaboration addFolderCollaborationByEmail(String folderId, String email, com.box.sdk.BoxCollaboration.Role role);

The box/addFolderCollaborationByEmail API method has the parameters listed in the table below:

Parameter Description Type

email

`${paramValue.description

''}`

String

folderId

`${paramValue.description

''}`

String

role

`${paramValue.description

''}`

Role

Method deleteCollaboration

Signatures:

  • void deleteCollaboration(String collaborationId);

The box/deleteCollaboration API method has the parameters listed in the table below:

Parameter Description Type

collaborationId

`${paramValue.description

Method getCollaborationInfo

Signatures:

  • com.box.sdk.BoxCollaboration.Info getCollaborationInfo(String collaborationId);

The box/getCollaborationInfo API method has the parameters listed in the table below:

Parameter Description Type

collaborationId

`${paramValue.description

Method getFolderCollaborations

Signatures:

  • java.util.Collection<com.box.sdk.BoxCollaboration.Info> getFolderCollaborations(String folderId);

The box/getFolderCollaborations API method has the parameters listed in the table below:

Parameter Description Type

folderId

`${paramValue.description

Method updateCollaborationInfo

Signatures:

  • com.box.sdk.BoxCollaboration updateCollaborationInfo(String collaborationId, com.box.sdk.BoxCollaboration.Info info);

The box/updateCollaborationInfo API method has the parameters listed in the table below:

Parameter Description Type

collaborationId

`${paramValue.description

''}`

String

info

`${paramValue.description

''}`

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

API: comments

Only producer is supported

The comments API is defined in the syntax as follows:

box:comments/methodName?[parameters]

The 6 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

addFileComment

add

Add comment to file

changeCommentMessage

updateMessage

Change comment message

deleteComment

delete

Delete comment

getCommentInfo

info

Get comment information

getFileComments

comments

Get a list of any comments on this file

replyToComment

reply

Reply to a comment

Method addFileComment

Signatures:

  • com.box.sdk.BoxFile addFileComment(String fileId, String message);

The box/addFileComment API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

message

`${paramValue.description

''}`

Method changeCommentMessage

Signatures:

  • com.box.sdk.BoxComment changeCommentMessage(String commentId, String message);

The box/changeCommentMessage API method has the parameters listed in the table below:

Parameter Description Type

commentId

`${paramValue.description

''}`

String

message

`${paramValue.description

''}`

Method deleteComment

Signatures:

  • void deleteComment(String commentId);

The box/deleteComment API method has the parameters listed in the table below:

Parameter Description Type

commentId

`${paramValue.description

Method getCommentInfo

Signatures:

  • com.box.sdk.BoxComment.Info getCommentInfo(String commentId);

The box/getCommentInfo API method has the parameters listed in the table below:

Parameter Description Type

commentId

`${paramValue.description

Method getFileComments

Signatures:

  • java.util.List<com.box.sdk.BoxComment.Info> getFileComments(String fileId);

The box/getFileComments API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

Method replyToComment

Signatures:

  • com.box.sdk.BoxComment replyToComment(String commentId, String message);

The box/replyToComment API method has the parameters listed in the table below:

Parameter Description Type

commentId

`${paramValue.description

''}`

String

message

`${paramValue.description

''}`

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

API: event-logs

Only producer is supported

The event-logs API is defined in the syntax as follows:

box:event-logs/methodName?[parameters]

The 1 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

getEnterpriseEvents

events

Create an event stream with optional starting initial position and add listener that will be notified when an event is received

Method getEnterpriseEvents

Signatures:

  • java.util.List<com.box.sdk.BoxEvent> getEnterpriseEvents(String position, java.util.Date after, java.util.Date before, com.box.sdk.BoxEvent.Type[] types);

The box/getEnterpriseEvents API method has the parameters listed in the table below:

Parameter Description Type

after

`${paramValue.description

''}`

Date

before

`${paramValue.description

''}`

Date

position

`${paramValue.description

''}`

String

types

`${paramValue.description

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

API: events

Only consumer is supported

The events API is defined in the syntax as follows:

box:events/methodName?[parameters]

The 1 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

listen

Create an event stream with optional starting initial position and add listener that will be notified when an event is received

Method listen

Signatures:

  • void listen(com.box.sdk.EventListener listener, Long startingPosition);

The box/listen API method has the parameters listed in the table below:

Parameter Description Type

startingPosition

`${paramValue.description

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

API: files

Only producer is supported

The files API is defined in the syntax as follows:

box:files/methodName?[parameters]

The 22 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

checkUpload

canUpload

Does a pre-verification before upload, to check if the filename already exists or if there is permission to upload

copyFile

copy

Copy file to destination folder while optionally giving it a new name

createFileMetadata

createMetadata

Create metadata for file in either the global properties template or the specified template type

createFileSharedLink

link

Create a shared link to file

deleteFile

delete

Delete the file

deleteFileMetadata

delete

Delete the file properties metadata

deleteFileVersion

delete

Delete a file version

downloadFile

download

Download a file

downloadPreviousFileVersion

downloadVersion

Download a previous version of file

getDownloadURL

url

Get an expiring URL for downloading a file directly from Box

getFileInfo

info

Get file information

getFileMetadata

metadata

Gets the file properties metadata

getFilePreviewLink

Get an expiring URL for creating an embedded preview session

getFileThumbnail

thumbnail

Retrieves a thumbnail, or smaller image representation, of this file

getFileVersions

versions

Get any previous versions of file

moveFile

move

Move file to destination folder while optionally giving it a new name

promoteFileVersion

promoteVersion

Promote a previous version of file

renameFile

rename

Rename file giving it the name newName

updateFileInfo

updateInfo

Update file information

updateFileMetadata

updateMetadata

Update the file properties metadata

uploadFile

upload

Upload a new file to parent folder

uploadNewFileVersion

uploadVersion

Upload a new version of file

Method checkUpload

Signatures:

  • void checkUpload(String fileName, String parentFolderId, Long size);

The box/checkUpload API method has the parameters listed in the table below:

Parameter Description Type

fileName

`${paramValue.description

''}`

String

parentFolderId

`${paramValue.description

''}`

String

size

`${paramValue.description

''}`

Long

Method copyFile

Signatures:

  • com.box.sdk.BoxFile copyFile(String fileId, String destinationFolderId, String newName);

The box/copyFile API method has the parameters listed in the table below:

Parameter Description Type

destinationFolderId

`${paramValue.description

''}`

String

fileId

`${paramValue.description

''}`

String

newName

`${paramValue.description

''}`

String

Method createFileMetadata

Signatures:

  • com.box.sdk.Metadata createFileMetadata(String fileId, com.box.sdk.Metadata metadata, String typeName);

The box/createFileMetadata API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

metadata

`${paramValue.description

''}`

Metadata

typeName

`${paramValue.description

''}`

String

Signatures:

  • com.box.sdk.BoxSharedLink createFileSharedLink(String fileId, com.box.sdk.BoxSharedLink.Access access, java.util.Date unshareDate, com.box.sdk.BoxSharedLink.Permissions permissions);

The box/createFileSharedLink API method has the parameters listed in the table below:

Parameter Description Type

access

`${paramValue.description

''}`

Access

fileId

`${paramValue.description

''}`

String

permissions

`${paramValue.description

''}`

Permissions

unshareDate

`${paramValue.description

Method deleteFile

Signatures:

  • void deleteFile(String fileId);

The box/deleteFile API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

Method deleteFileMetadata

Signatures:

  • void deleteFileMetadata(String fileId);

The box/deleteFileMetadata API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

Method deleteFileVersion

Signatures:

  • void deleteFileVersion(String fileId, Integer version);

The box/deleteFileVersion API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

version

`${paramValue.description

''}`

Method downloadFile

Signatures:

  • java.io.OutputStream downloadFile(String fileId, java.io.OutputStream output, Long rangeStart, Long rangeEnd, com.box.sdk.ProgressListener listener);

The box/downloadFile API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

listener

`${paramValue.description

''}`

ProgressListener

output

`${paramValue.description

''}`

OutputStream

rangeEnd

`${paramValue.description

''}`

Long

rangeStart

`${paramValue.description

''}`

Method downloadPreviousFileVersion

Signatures:

  • java.io.OutputStream downloadPreviousFileVersion(String fileId, Integer version, java.io.OutputStream output, com.box.sdk.ProgressListener listener);

The box/downloadPreviousFileVersion API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

listener

`${paramValue.description

''}`

ProgressListener

output

`${paramValue.description

''}`

OutputStream

version

`${paramValue.description

Method getDownloadURL

Signatures:

  • java.net.URL getDownloadURL(String fileId);

The box/getDownloadURL API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

Method getFileInfo

Signatures:

  • com.box.sdk.BoxFile.Info getFileInfo(String fileId, String[] fields);

The box/getFileInfo API method has the parameters listed in the table below:

Parameter Description Type

fields

`${paramValue.description

''}`

String[]

fileId

`${paramValue.description

''}`

Method getFileMetadata

Signatures:

  • com.box.sdk.Metadata getFileMetadata(String fileId, String typeName);

The box/getFileMetadata API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

typeName

`${paramValue.description

''}`

Signatures:

  • java.net.URL getFilePreviewLink(String fileId);

The box/getFilePreviewLink API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

Method getFileThumbnail

Signatures:

  • byte[] getFileThumbnail(String fileId, com.box.sdk.BoxFile.ThumbnailFileType fileType, Integer minWidth, Integer minHeight, Integer maxWidth, Integer maxHeight);

The box/getFileThumbnail API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

fileType

`${paramValue.description

''}`

ThumbnailFileType

maxHeight

`${paramValue.description

''}`

Integer

maxWidth

`${paramValue.description

''}`

Integer

minHeight

`${paramValue.description

''}`

Integer

minWidth

`${paramValue.description

''}`

Integer

Method getFileVersions

Signatures:

  • java.util.Collection<com.box.sdk.BoxFileVersion> getFileVersions(String fileId);

The box/getFileVersions API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

Method moveFile

Signatures:

  • com.box.sdk.BoxFile moveFile(String fileId, String destinationFolderId, String newName);

The box/moveFile API method has the parameters listed in the table below:

Parameter Description Type

destinationFolderId

`${paramValue.description

''}`

String

fileId

`${paramValue.description

''}`

String

newName

`${paramValue.description

''}`

String

Method promoteFileVersion

Signatures:

  • com.box.sdk.BoxFileVersion promoteFileVersion(String fileId, Integer version);

The box/promoteFileVersion API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

version

`${paramValue.description

''}`

Method renameFile

Signatures:

  • com.box.sdk.BoxFile renameFile(String fileId, String newFileName);

The box/renameFile API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

newFileName

`${paramValue.description

''}`

Method updateFileInfo

Signatures:

  • com.box.sdk.BoxFile updateFileInfo(String fileId, com.box.sdk.BoxFile.Info info);

The box/updateFileInfo API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

info

`${paramValue.description

''}`

Method updateFileMetadata

Signatures:

  • com.box.sdk.Metadata updateFileMetadata(String fileId, com.box.sdk.Metadata metadata);

The box/updateFileMetadata API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

''}`

String

metadata

`${paramValue.description

''}`

Method uploadFile

Signatures:

  • com.box.sdk.BoxFile uploadFile(String parentFolderId, java.io.InputStream content, String fileName, java.util.Date created, java.util.Date modified, Long size, Boolean check, com.box.sdk.ProgressListener listener);

The box/uploadFile API method has the parameters listed in the table below:

Parameter Description Type

check

`${paramValue.description

''}`

Boolean

content

`${paramValue.description

''}`

InputStream

created

`${paramValue.description

''}`

Date

fileName

`${paramValue.description

''}`

String

listener

`${paramValue.description

''}`

ProgressListener

modified

`${paramValue.description

''}`

Date

parentFolderId

`${paramValue.description

''}`

String

size

`${paramValue.description

''}`

Method uploadNewFileVersion

Signatures:

  • com.box.sdk.BoxFile uploadNewFileVersion(String fileId, java.io.InputStream fileContent, java.util.Date modified, Long fileSize, com.box.sdk.ProgressListener listener);

The box/uploadNewFileVersion API method has the parameters listed in the table below:

Parameter Description Type

fileContent

`${paramValue.description

''}`

InputStream

fileId

`${paramValue.description

''}`

String

fileSize

`${paramValue.description

''}`

Long

listener

`${paramValue.description

''}`

ProgressListener

modified

`${paramValue.description

''}`

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

API: folders

Only producer is supported

The folders API is defined in the syntax as follows:

box:folders/methodName?[parameters]

The 10 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

copyFolder

copy

Copy folder to destination folder while optionally giving it a new name

createFolder

create

Create a folder specified by path from parent folder with given parentFolderId, creating intermediate directories as required

createFolderSharedLink

create

Create a shared link to folder

deleteFolder

delete

Delete folder

getFolder

folder

Return the Box folder referenced by path

getFolderInfo

folder

Get folder information

getFolderItems

folder

Returns a specific range of child items in folder and specifies which fields of each item to retrieve

moveFolder

move

Move folder to destination folder while optionally giving it a new name

renameFolder

rename

Rename folder giving it the name newName

updateFolderInfo

updateInfo

Update folder information

Method copyFolder

Signatures:

  • com.box.sdk.BoxFolder copyFolder(String folderId, String destinationFolderId, String newName);

The box/copyFolder API method has the parameters listed in the table below:

Parameter Description Type

destinationFolderId

`${paramValue.description

''}`

String

folderId

`${paramValue.description

''}`

String

newName

`${paramValue.description

''}`

String

Method createFolder

Signatures:

  • com.box.sdk.BoxFolder createFolder(String parentFolderId, String folderName);

  • com.box.sdk.BoxFolder createFolder(String parentFolderId, String[] path);

The box/createFolder API method has the parameters listed in the table below:

Parameter Description Type

folderName

`${paramValue.description

''}`

String

parentFolderId

`${paramValue.description

''}`

String

path

`${paramValue.description

''}`

String[]

Signatures:

  • com.box.sdk.BoxSharedLink createFolderSharedLink(String folderId, com.box.sdk.BoxSharedLink.Access access, java.util.Date unshareDate, com.box.sdk.BoxSharedLink.Permissions permissions);

The box/createFolderSharedLink API method has the parameters listed in the table below:

Parameter Description Type

access

`${paramValue.description

''}`

Access

folderId

`${paramValue.description

''}`

String

permissions

`${paramValue.description

''}`

Permissions

unshareDate

`${paramValue.description

Method deleteFolder

Signatures:

  • void deleteFolder(String folderId);

The box/deleteFolder API method has the parameters listed in the table below:

Parameter Description Type

folderId

`${paramValue.description

Method getFolder

Signatures:

  • com.box.sdk.BoxFolder getFolder(String[] path);

The box/getFolder API method has the parameters listed in the table below:

Parameter Description Type

path

`${paramValue.description

Method getFolderInfo

Signatures:

  • com.box.sdk.BoxFolder.Info getFolderInfo(String folderId, String[] fields);

The box/getFolderInfo API method has the parameters listed in the table below:

Parameter Description Type

fields

`${paramValue.description

''}`

String[]

folderId

`${paramValue.description

''}`

Method getFolderItems

Signatures:

  • java.util.Collection<com.box.sdk.BoxItem.Info> getFolderItems(String folderId, Long offset, Long limit, String[] fields);

The box/getFolderItems API method has the parameters listed in the table below:

Parameter Description Type

fields

`${paramValue.description

''}`

String[]

folderId

`${paramValue.description

''}`

String

limit

`${paramValue.description

''}`

Long

offset

`${paramValue.description

Method moveFolder

Signatures:

  • com.box.sdk.BoxFolder moveFolder(String folderId, String destinationFolderId, String newName);

The box/moveFolder API method has the parameters listed in the table below:

Parameter Description Type

destinationFolderId

`${paramValue.description

''}`

String

folderId

`${paramValue.description

''}`

String

newName

`${paramValue.description

''}`

String

Method renameFolder

Signatures:

  • com.box.sdk.BoxFolder renameFolder(String folderId, String newFolderName);

The box/renameFolder API method has the parameters listed in the table below:

Parameter Description Type

folderId

`${paramValue.description

''}`

String

newFolderName

`${paramValue.description

''}`

Method updateFolderInfo

Signatures:

  • com.box.sdk.BoxFolder updateFolderInfo(String folderId, com.box.sdk.BoxFolder.Info info);

The box/updateFolderInfo API method has the parameters listed in the table below:

Parameter Description Type

folderId

`${paramValue.description

''}`

String

info

`${paramValue.description

''}`

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

API: groups

Only producer is supported

The groups API is defined in the syntax as follows:

box:groups/methodName?[parameters]

The 9 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

addGroupMembership

addMembership

Add a member to group with the specified role

createGroup

create

Create a new group with a specified name and optional additional parameters

deleteGroup

delete

Delete group

deleteGroupMembership

delete

Delete group membership

getGroupInfo

info

Get group information

getGroupMembershipInfo

membershipInfo

Get group membership information

getGroupMemberships

memberships

Get information about all of the group memberships for this group

updateGroupInfo

Update group information

updateGroupMembershipInfo

updateMembershipInfo

Update group membership information

Method addGroupMembership

Signatures:

  • com.box.sdk.BoxGroupMembership addGroupMembership(String groupId, String userId, com.box.sdk.BoxGroupMembership.Role role);

The box/addGroupMembership API method has the parameters listed in the table below:

Parameter Description Type

groupId

`${paramValue.description

''}`

String

role

`${paramValue.description

''}`

Role

userId

`${paramValue.description

''}`

String

Method createGroup

Signatures:

  • com.box.sdk.BoxGroup createGroup(String name, String provenance, String externalSyncIdentifier, String description, String invitabilityLevel, String memberViewabilityLevel);

The box/createGroup API method has the parameters listed in the table below:

Parameter Description Type

description

`${paramValue.description

''}`

String

externalSyncIdentifier

`${paramValue.description

''}`

String

invitabilityLevel

`${paramValue.description

''}`

String

memberViewabilityLevel

`${paramValue.description

''}`

String

name

`${paramValue.description

''}`

String

provenance

`${paramValue.description

''}`

String

Method deleteGroup

Signatures:

  • void deleteGroup(String groupId);

The box/deleteGroup API method has the parameters listed in the table below:

Parameter Description Type

groupId

`${paramValue.description

Method deleteGroupMembership

Signatures:

  • void deleteGroupMembership(String groupMembershipId);

The box/deleteGroupMembership API method has the parameters listed in the table below:

Parameter Description Type

groupMembershipId

`${paramValue.description

Method getGroupInfo

Signatures:

  • com.box.sdk.BoxGroup.Info getGroupInfo(String groupId);

The box/getGroupInfo API method has the parameters listed in the table below:

Parameter Description Type

groupId

`${paramValue.description

Method getGroupMembershipInfo

Signatures:

  • com.box.sdk.BoxGroupMembership.Info getGroupMembershipInfo(String groupMembershipId);

The box/getGroupMembershipInfo API method has the parameters listed in the table below:

Parameter Description Type

groupMembershipId

`${paramValue.description

Method getGroupMemberships

Signatures:

  • java.util.Collection<com.box.sdk.BoxGroupMembership.Info> getGroupMemberships(String groupId);

The box/getGroupMemberships API method has the parameters listed in the table below:

Parameter Description Type

groupId

`${paramValue.description

Method updateGroupInfo

Signatures:

  • com.box.sdk.BoxGroup updateGroupInfo(String groupId, com.box.sdk.BoxGroup.Info groupInfo);

The box/updateGroupInfo API method has the parameters listed in the table below:

Parameter Description Type

groupId

`${paramValue.description

''}`

String

groupInfo

`${paramValue.description

''}`

Method updateGroupMembershipInfo

Signatures:

  • com.box.sdk.BoxGroupMembership updateGroupMembershipInfo(String groupMembershipId, com.box.sdk.BoxGroupMembership.Info info);

The box/updateGroupMembershipInfo API method has the parameters listed in the table below:

Parameter Description Type

groupMembershipId

`${paramValue.description

''}`

String

info

`${paramValue.description

''}`

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

Only producer is supported

The search API is defined in the syntax as follows:

box:search/methodName?[parameters]

The 1 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

searchFolder

search

Search folder and all descendant folders using the given query

Method searchFolder

Signatures:

  • java.util.Collection<com.box.sdk.BoxItem> searchFolder(String folderId, String query);

The box/searchFolder API method has the parameters listed in the table below:

Parameter Description Type

folderId

`${paramValue.description

''}`

String

query

`${paramValue.description

''}`

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

API: tasks

Only producer is supported

The tasks API is defined in the syntax as follows:

box:tasks/methodName?[parameters]

The 9 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

addAssignmentToTask

addAssignment

Add assignment for task

addFileTask

add

Add task to file

deleteTask

delete

Delete task

deleteTaskAssignment

delete

Delete task assignment

getFileTasks

tasks

Get a list of any tasks on file

getTaskAssignmentInfo

assignmentInfo

Get task assignment information

getTaskAssignments

assignments

Get a list of any assignments for task

getTaskInfo

info

Get task information

updateTaskInfo

updateInfo

Update task information

Method addAssignmentToTask

Signatures:

  • com.box.sdk.BoxTask addAssignmentToTask(String taskId, com.box.sdk.BoxUser assignTo);

The box/addAssignmentToTask API method has the parameters listed in the table below:

Parameter Description Type

assignTo

`${paramValue.description

''}`

BoxUser

taskId

`${paramValue.description

''}`

Method addFileTask

Signatures:

  • com.box.sdk.BoxTask addFileTask(String fileId, com.box.sdk.BoxTask.Action action, java.util.Date dueAt, String message);

The box/addFileTask API method has the parameters listed in the table below:

Parameter Description Type

action

`${paramValue.description

''}`

Action

dueAt

`${paramValue.description

''}`

Date

fileId

`${paramValue.description

''}`

String

message

`${paramValue.description

Method deleteTask

Signatures:

  • void deleteTask(String taskId);

The box/deleteTask API method has the parameters listed in the table below:

Parameter Description Type

taskId

`${paramValue.description

Method deleteTaskAssignment

Signatures:

  • void deleteTaskAssignment(String taskAssignmentId);

The box/deleteTaskAssignment API method has the parameters listed in the table below:

Parameter Description Type

taskAssignmentId

`${paramValue.description

Method getFileTasks

Signatures:

  • java.util.List<com.box.sdk.BoxTask.Info> getFileTasks(String fileId);

The box/getFileTasks API method has the parameters listed in the table below:

Parameter Description Type

fileId

`${paramValue.description

Method getTaskAssignmentInfo

Signatures:

  • com.box.sdk.BoxTaskAssignment.Info getTaskAssignmentInfo(String taskAssignmentId);

The box/getTaskAssignmentInfo API method has the parameters listed in the table below:

Parameter Description Type

taskAssignmentId

`${paramValue.description

Method getTaskAssignments

Signatures:

  • java.util.List<com.box.sdk.BoxTaskAssignment.Info> getTaskAssignments(String taskId);

The box/getTaskAssignments API method has the parameters listed in the table below:

Parameter Description Type

taskId

`${paramValue.description

Method getTaskInfo

Signatures:

  • com.box.sdk.BoxTask.Info getTaskInfo(String taskId);

The box/getTaskInfo API method has the parameters listed in the table below:

Parameter Description Type

taskId

`${paramValue.description

Method updateTaskInfo

Signatures:

  • com.box.sdk.BoxTask updateTaskInfo(String taskId, com.box.sdk.BoxTask.Info info);

The box/updateTaskInfo API method has the parameters listed in the table below:

Parameter Description Type

info

`${paramValue.description

''}`

Info

taskId

`${paramValue.description

''}`

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

API: users

Only producer is supported

The users API is defined in the syntax as follows:

box:users/methodName?[parameters]

The 10 method(s) is listed in the table below, followed by detailed syntax for each method. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

addUserEmailAlias

addEmailAlias

Add a new email alias to user’s account

createAppUser

create

Provision a new app user in an enterprise with additional user information using Box Developer Edition

createEnterpriseUser

create

Provision a new user in an enterprise with additional user information

deleteUser

delete

Delete user from an enterprise account

deleteUserEmailAlias

delete

Delete an email alias from user’s account

getAllEnterpriseOrExternalUsers

users

Get any managed users that match the filter term as well as any external users that match the filter term

getUserEmailAlias

emailAlias

Get a collection of all the email aliases for user

getUserInfo

info

Get user information

moveFolderToUser

Move root folder for specified user to current user

updateUserInfo

updateInfo

Update user information

Method addUserEmailAlias

Signatures:

  • com.box.sdk.EmailAlias addUserEmailAlias(String userId, String email);

The box/addUserEmailAlias API method has the parameters listed in the table below:

Parameter Description Type

email

`${paramValue.description

''}`

String

userId

`${paramValue.description

''}`

Method createAppUser

Signatures:

  • com.box.sdk.BoxUser createAppUser(String name, com.box.sdk.CreateUserParams params);

The box/createAppUser API method has the parameters listed in the table below:

Parameter Description Type

name

`${paramValue.description

''}`

String

params

`${paramValue.description

''}`

Method createEnterpriseUser

Signatures:

  • com.box.sdk.BoxUser createEnterpriseUser(String login, String name, com.box.sdk.CreateUserParams params);

The box/createEnterpriseUser API method has the parameters listed in the table below:

Parameter Description Type

login

`${paramValue.description

''}`

String

name

`${paramValue.description

''}`

String

params

`${paramValue.description

''}`

CreateUserParams

Method deleteUser

Signatures:

  • void deleteUser(String userId, boolean notifyUser, boolean force);

The box/deleteUser API method has the parameters listed in the table below:

Parameter Description Type

force

`${paramValue.description

''}`

Boolean

notifyUser

`${paramValue.description

''}`

Boolean

userId

`${paramValue.description

''}`

String

Method deleteUserEmailAlias

Signatures:

  • void deleteUserEmailAlias(String userId, String emailAliasId);

The box/deleteUserEmailAlias API method has the parameters listed in the table below:

Parameter Description Type

emailAliasId

`${paramValue.description

''}`

String

userId

`${paramValue.description

''}`

Method getAllEnterpriseOrExternalUsers

Signatures:

  • java.util.List<com.box.sdk.BoxUser.Info> getAllEnterpriseOrExternalUsers(String filterTerm, String[] fields);

The box/getAllEnterpriseOrExternalUsers API method has the parameters listed in the table below:

Parameter Description Type

fields

`${paramValue.description

''}`

String[]

filterTerm

`${paramValue.description

''}`

Method getUserEmailAlias

Signatures:

  • java.util.Collection<com.box.sdk.EmailAlias> getUserEmailAlias(String userId);

The box/getUserEmailAlias API method has the parameters listed in the table below:

Parameter Description Type

userId

`${paramValue.description

Method getUserInfo

Signatures:

  • com.box.sdk.BoxUser.Info getUserInfo(String userId);

The box/getUserInfo API method has the parameters listed in the table below:

Parameter Description Type

userId

`${paramValue.description

Method moveFolderToUser

Signatures:

  • com.box.sdk.BoxFolder.Info moveFolderToUser(String userId, String sourceUserId);

The box/moveFolderToUser API method has the parameters listed in the table below:

Parameter Description Type

sourceUserId

`${paramValue.description

''}`

String

userId

`${paramValue.description

''}`

Method updateUserInfo

Signatures:

  • com.box.sdk.BoxUser updateUserInfo(String userId, com.box.sdk.BoxUser.Info info);

The box/updateUserInfo API method has the parameters listed in the table below:

Parameter Description Type

info

`${paramValue.description

''}`

Info

userId

`${paramValue.description

''}`

In addition to the parameters above, the box API can also use any of the Query Parameters (19 parameters).

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBox.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBox.myParameterNameHere header.

Samples

The following route uploads new files to the user’s root folder:

from("file:...")
    .to("box://files/upload/inBody=fileUploadRequest");

The following route polls user’s account for updates:

from("box://events/listen?startingPosition=-1")
    .to("bean:blah");

The following route uses a producer with dynamic header options. The fileId property has the Box file id and the output property has the output stream of the file contents, so they are assigned to the CamelBox.fileId header and CamelBox.output header respectively as follows:

from("direct:foo")
    .setHeader("CamelBox.fileId", header("fileId"))
    .setHeader("CamelBox.output", header("output"))
    .to("box://files/download")
    .to("file://...");

More information

See more details at the Box API reference: https://developer.box.com/reference