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 |
|---|---|---|---|
Box application client ID. |
String |
||
To use the shared configuration. |
BoxConfiguration |
||
The enterprise ID to use for an App Enterprise. |
String |
||
The user ID to use for an App User. |
String |
||
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 |
|
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 |
|
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 |
|
Custom HTTP params for settings like proxy host. |
Map |
||
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 |
|
Custom Access Token Cache for storing and retrieving access tokens. |
IAccessTokenCache |
||
Box application client secret. |
String |
||
The type of encryption algorithm for JWT. Supported Algorithms: RSA_SHA_256 RSA_SHA_384 RSA_SHA_512. Enum values:
|
RSA_SHA_256 |
EncryptionAlgorithm |
|
The maximum number of access tokens in cache. |
100 |
int |
|
The private key for generating the JWT signature. |
String |
||
The password for the private key. |
String |
||
The ID for public key for validating the JWT signature. |
String |
||
To configure security using SSLContextParameters. |
SSLContextParameters |
||
Box user name, MUST be provided. |
String |
||
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 |
|---|---|---|---|
Required What kind of operation to perform. Enum values:
|
BoxApiName |
||
Required What sub operation to use for the selected operation. |
String |
Query Parameters (19 parameters)
| Name | Description | Default | Type |
|---|---|---|---|
Box application client ID. |
String |
||
The enterprise ID to use for an App Enterprise. |
String |
||
Sets the name of a parameter to be passed in the exchange In Body. |
String |
||
The user ID to use for an App User. |
String |
||
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 |
||
Sets the exchange pattern when the consumer creates an exchange. Enum values:
|
ExchangePattern |
||
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 |
|
Custom HTTP params for settings like proxy host. |
Map |
||
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 |
|
Custom Access Token Cache for storing and retrieving access tokens. |
IAccessTokenCache |
||
Box application client secret. |
String |
||
The type of encryption algorithm for JWT. Supported Algorithms: RSA_SHA_256 RSA_SHA_384 RSA_SHA_512. Enum values:
|
RSA_SHA_256 |
EncryptionAlgorithm |
|
The maximum number of access tokens in cache. |
100 |
int |
|
The private key for generating the JWT signature. |
String |
||
The password for the private key. |
String |
||
The ID for public key for validating the JWT signature. |
String |
||
To configure security using SSLContextParameters. |
SSLContextParameters |
||
Box user name, MUST be provided. |
String |
||
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 |
|---|---|---|
Producer |
Provides operations to manage Box collaborations |
|
Producer |
Provides operations to manage Box comments |
|
Producer |
Provides operations to read Box enterprise (admin) event logs |
|
Consumer |
Provides operations to manage Box events |
|
Producer |
Provides operations to manage Box files |
|
Producer |
Provides operations to manage Box folders |
|
Producer |
Provides operations to manage Box groups |
|
Producer |
Provides operations to manage Box searches |
|
Producer |
Provides operations to manage Box tasks |
|
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 |
|---|---|---|
add |
Add a collaboration to this folder |
|
add |
Add a collaboration to this folder |
|
delete |
Delete collaboration |
|
info |
Get collaboration information |
|
collaborations |
Get information about all of the collaborations for folder |
|
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
BoxCollaborator |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
add |
Add comment to file |
|
updateMessage |
Change comment message |
|
delete |
Delete comment |
|
info |
Get comment information |
|
comments |
Get a list of any comments on this file |
|
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
Date |
|
`${paramValue.description |
''}` |
|
Date |
|
`${paramValue.description |
''}` |
String |
|
|
`${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 |
|---|---|---|
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 |
|---|---|---|
|
`${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 |
|---|---|---|
canUpload |
Does a pre-verification before upload, to check if the filename already exists or if there is permission to upload |
|
copy |
Copy file to destination folder while optionally giving it a new name |
|
createMetadata |
Create metadata for file in either the global properties template or the specified template type |
|
link |
Create a shared link to file |
|
delete |
Delete the file |
|
delete |
Delete the file properties metadata |
|
delete |
Delete a file version |
|
download |
Download a file |
|
downloadVersion |
Download a previous version of file |
|
url |
Get an expiring URL for downloading a file directly from Box |
|
info |
Get file information |
|
metadata |
Gets the file properties metadata |
|
Get an expiring URL for creating an embedded preview session |
||
thumbnail |
Retrieves a thumbnail, or smaller image representation, of this file |
|
versions |
Get any previous versions of file |
|
move |
Move file to destination folder while optionally giving it a new name |
|
promoteVersion |
Promote a previous version of file |
|
rename |
Rename file giving it the name newName |
|
updateInfo |
Update file information |
|
updateMetadata |
Update the file properties metadata |
|
upload |
Upload a new file to parent folder |
|
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
Metadata |
|
`${paramValue.description |
''}` |
String |
Method createFileSharedLink
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
Access |
|
`${paramValue.description |
''}` |
|
String |
|
`${paramValue.description |
''}` |
Permissions |
|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
ProgressListener |
|
`${paramValue.description |
''}` |
OutputStream |
|
|
`${paramValue.description |
|
''}` |
Long |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
ProgressListener |
|
`${paramValue.description |
''}` |
OutputStream |
|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String[] |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
Method getFilePreviewLink
Signatures:
-
java.net.URL getFilePreviewLink(String fileId);
The box/getFilePreviewLink API method has the parameters listed in the table below:
| Parameter | Description | Type |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
ThumbnailFileType |
|
`${paramValue.description |
''}` |
Integer |
|
|
`${paramValue.description |
|
''}` |
Integer |
|
`${paramValue.description |
''}` |
|
Integer |
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
Boolean |
|
`${paramValue.description |
''}` |
|
InputStream |
|
`${paramValue.description |
''}` |
Date |
|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
ProgressListener |
|
`${paramValue.description |
''}` |
Date |
|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
InputStream |
|
`${paramValue.description |
''}` |
|
String |
|
`${paramValue.description |
''}` |
Long |
|
|
`${paramValue.description |
|
''}` |
ProgressListener |
|
`${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 |
|---|---|---|
copy |
Copy folder to destination folder while optionally giving it a new name |
|
create |
Create a folder specified by path from parent folder with given parentFolderId, creating intermediate directories as required |
|
create |
Create a shared link to folder |
|
delete |
Delete folder |
|
folder |
Return the Box folder referenced by path |
|
folder |
Get folder information |
|
folder |
Returns a specific range of child items in folder and specifies which fields of each item to retrieve |
|
move |
Move folder to destination folder while optionally giving it a new name |
|
rename |
Rename folder giving it the name newName |
|
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${paramValue.description |
''}` |
String[] |
Method createFolderSharedLink
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
Access |
|
`${paramValue.description |
''}` |
|
String |
|
`${paramValue.description |
''}` |
Permissions |
|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String[] |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String[] |
|
`${paramValue.description |
''}` |
|
String |
|
`${paramValue.description |
''}` |
Long |
|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
addMembership |
Add a member to group with the specified role |
|
create |
Create a new group with a specified name and optional additional parameters |
|
delete |
Delete group |
|
delete |
Delete group membership |
|
info |
Get group information |
|
membershipInfo |
Get group membership information |
|
memberships |
Get information about all of the group memberships for this group |
|
Update group information |
||
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
Role |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${paramValue.description |
''}` |
String |
|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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: search
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 |
|---|---|---|
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
addAssignment |
Add assignment for task |
|
add |
Add task to file |
|
delete |
Delete task |
|
delete |
Delete task assignment |
|
tasks |
Get a list of any tasks on file |
|
assignmentInfo |
Get task assignment information |
|
assignments |
Get a list of any assignments for task |
|
info |
Get task information |
|
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
BoxUser |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
Action |
|
`${paramValue.description |
''}` |
|
Date |
|
`${paramValue.description |
''}` |
String |
|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
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: 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 |
|---|---|---|
addEmailAlias |
Add a new email alias to user’s account |
|
create |
Provision a new app user in an enterprise with additional user information using Box Developer Edition |
|
create |
Provision a new user in an enterprise with additional user information |
|
delete |
Delete user from an enterprise account |
|
delete |
Delete an email alias from user’s account |
|
users |
Get any managed users that match the filter term as well as any external users that match the filter term |
|
emailAlias |
Get a collection of all the email aliases for user |
|
info |
Get user information |
|
Move root folder for specified user to current user |
||
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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${paramValue.description |
''}` |
|
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
Boolean |
|
`${paramValue.description |
''}` |
|
Boolean |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String[] |
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
String |
|
`${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 |
|---|---|---|
|
`${paramValue.description |
|
''}` |
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.
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