To use fields with data types, such as array, boolean, double, or integer, you must use annotation as shown in the following sample code:
- •The Get Access Token action creates a bearer token that allows an OAuth client to authenticate with the Box API using parameter values from the connection properties.
- •The Upload File action uploads a new file to Box.
Attach a file and provide the file name, along with the parent folder to upload the file to, in the request body.
The following snippet is a sample request body:
<root>
<name>test.txt</name>
<parent>
<id>327497224477</id>
</parent>
</root>
Response returns the new file object in a list.
- •The Upload File Version action uploads a new version of an existing file to Box.
Provide the file ID for which you want to upload a new version and attach the file version. You can also include optional values in the request body.
The following snippet is a sample request body:
<root>
<name>test_v2.txt</name>
</root>
Response returns the new file object in a list.
- •The Get File Information action retrieves detailed information about a specific file using ID.
Example of retrieving file information using a password-protected shared link:
- •The Get Folder Information action retrieves details about a folder using ID, including up to the first 100 items contained within it.
Example of retrieving folder information using a password-protected shared link:
- •The List Items In Folder action retrieves a paginated list of items contained in a folder using the ID.
The following snippet is an example of retrieving a list of two item names and their IDs in a folder, using sorting, filtering, and pagination through query parameters:
You must provide the folder ID in the folderId field.
Query parameters:
<root>
<fields>name, id</fields>
<sort>name</sort>
<limit>2</limit>
<usemarker>true</usemarker>
</root>
The following snippet is a sample response:
<root>
<next_marker>eyJ0eXBlIjoiZmlsZSIsImRpciI6Im5leHQiLCJ0YWlsIjoiZXlKMWMyVnlYMmxrSWpvME1qazRPVEF6T1RjMU9Td2labTlzWkdWeVgybGtJam96TWpjME9UY3lNalEwTnpjc0ltUmxiR1YwWldRaU9qQXNJbVpwYkdWZmJtRnRaU0k2SW14dmNtVnRMbkJrWmlJc0ltWnBiR1ZmYVdRaU9qRTVNVEE0TkRZeE16STRPVGg5In0=</next_marker>
<entries>
<name>Text files - Copy</name>
<etag>0</etag>
<id>328080769791</id>
<type>folder</type>
</entries>
<entries>
<name>lorem.pdf</name>
<etag>0</etag>
<id>1910846132898</id>
<type>file</type>
</entries>
<limit>2</limit>
<order>
<by>name</by>
<direction>ASC</direction>
</order>
</root>
- •The Search For Content action searches for files, folders, web links, and shared files either within the user's content or across the entire enterprise.
Provide search information about an object in the query parameters.
The following snippet is an example of searching for a text file named Test:
queryParameters:
<root>
<type>file</type>
<content_types>name</content_types>
<file_extensions>txt</file_extensions>
<query>test</query>
</root>
- •The Query Object By Metadata action performs a search using SQL-like syntax to return items that match specific metadata criteria.
By default, this action returns only the most basic information about the items for which the query matches. To get additional fields for each item, including any of the metadata, use the fields attribute in the query.
Specify the metadata template used in the query. It must be in the following format in the request body:
scope.templateKey. ancestor folder ID
The following snippet is a sample request body:
<root>
<from>enterprise_1234567890.customer</from>
<query>name = :name_value</query>
<query_params>
<name_value>John</name_value>
</query_params>
<ancestor_folder_id>0987654321</ancestor_folder_id>
</root>
- •The Create Object action creates a Box object, such as a folder, sign request, comment, collaboration, or other supported resources.
To use the Create Object action, specify the path parameters for the object you want to create or copy. Also, provide values for the requestBody and queryParameters fields, if required.
Example of creating a folder:
Path parameters:
<root>
<pathParameter>folders</pathParameter>
</root>
The following snippet is a sample request body:
<root>
<name>Documents</name>
<parent>
<id>0</id>
</parent>
</root>
If the provided values are correct, the response will return a Folder object.
Example of copying a folder:
Path parameters:
<root>
<pathParameter>folders</pathParameter>
<pathParameter>0123456789</pathParameter>
<pathParameter>copy</pathParameter>
</root>
The following snippet is a sample request body:
<root>
<name>Documents_copy</name>
<parent>
<id>0</id>
</parent>
</root>
If the provided values are correct, the response will return a Folder object.
Example of creating a sign request:
Path parameters:
<root>
<pathParameter>sign_requests</pathParameter>
</root>
The following snippet is a sample request body:
<root xmlns:m="urn:informatica:ae:xquery:json2xml:meta-data">
<signers m:isArray="true">
<role>signer</role>
<email>example@example.com</email>
</signers>
<source_files m:isArray="true">
<type>file</type>
<id>0123456789</id>
</source_files>
<parent_folder>
<type>folder</type>
<id>9876543210</id>
</parent_folder>
</root>
- •The Delete Object action deletes a Box object by its ID, such as a file, folder, comment, or other supported resource.
To use the Delete Object action, provide the path parameters of the object you want to delete. Also, provide a value for the queryParameters field if required.
The following snippet is an example of deleting a folder:
Path parameters:
<root>
<pathParameter>folders</pathParameter>
<pathParameter>332066581615</pathParameter>
</root>
- •The Get Object action retrieves Box object information, such as a file request, comment, collaboration, or other supported resource.
To use the Get Object action, provide the path parameters for the object you want to retrieve. Also, provide a value for the queryParameters field if required.
The following snippet is an example of retrieving a list of items in a folder, additionally filtered and sorted using query parameters:
Path parameters:
<root>
<pathParameter>folders</pathParameter>
<pathParameter>329237142032</pathParameter>
<pathParameter>items</pathParameter>
</root>
Query parameters:
<root>
<fields>name, id</fields>
<sort>name</sort>
</root>
The following snippet is a sample response:
<root>
<entries>
<name>js.png</name>
<etag>0</etag>
<id>1913482002032</id>
<type>file</type>
</entries>
<entries>
<name>js2.png</name>
<etag>0</etag>
<id>1916868805650</id>
<type>file</type>
</entries>
<entries>
<name>lorem2_copy.txt</name>
<etag>0</etag>
<id>1916853796452</id>
<type>file</type>
</entries>
<offset>0</offset>
<total_count>3</total_count>
<limit>100</limit>
<order>
<by>type</by>
<direction>ASC</direction>
</order>
<order>
<by>name</by>
<direction>ASC</direction>
</order>
</root>
- •The Update Object action updates an existing Box object, such as a file request, folder, file, or other supported resource.
To use the Update Object action, provide the path parameters for the object you want to update. Also, include values for the requestBody and queryParameters fields if required.
Example of updating a folder:
Path parameters:
<root>
<pathParameter>folders</pathParameter>
<pathParameter>332066581615</pathParameter>
</root>
The following snippet is a sample request body:
<root>
<name>New folder name</name>
</root>
If the provided values are correct, the response will return the updated folder object.
- •The Download File action returns the contents of a file in binary format.
Provide the file ID of the file you want to download in the fileId field.
Response returns the requested file.