- 01 Feb 2023
- 3 Minutes to read
- DarkLight
Box
- Updated on 01 Feb 2023
- 3 Minutes to read
- DarkLight
Box is a cloud-based content management system that includes collaboration, security, analytics, and other features related to information and file storage. There are two session types, each of which allow you to do certain tasks.
Create a Box steps integration in Torq
- Go to Integrations > Steps.
- Locate Box and click Add.
- Enter a meaningful name for the integration and click Add.
- In your Box Developer account, enter the application you want to connect to and go to Configuration.
- Copy the Client ID under the OAuth 2.0 Credentials and paste that into the Client ID form in Torq.
- Click Fetch Client Secret and copy that into the form in Torq. In order to retrieve the Client Secret, your Box enterprise must have two-factor authentication enabled.
Use Box steps in Torq
All Box steps require that you pass an access token as an input parameter. To generate an access token, you need to execute the step Create a session.
Create a session
Select enterprise session for steps requiring the enterprise account, and user session for steps running in an individual user's account. You will need the enterprise or user ID, both of which can be found in Box's General Settings.
After creating a session, you can proceed with any of the Box steps Torq has included, or create an HTTP step of your own.
Get users in enterprise
All you need for this step is to run the Create Session step with your enterprise ID, and use the Access Token generated. A list of all users will be returned to you.
Search content
- Use the Access Token created in {{ $.create_session.api_object.access_token }}
- Search for the information you would like to find, using quotation marks for exact matches (e.g: “John Doe” and not “john doe”)
- You may search for multiple items at once by using the AND, OR, and NOT operators. For example: John Doe AND “Mississippi” OR torq will get you all the files that include mentions of both John Doe (or john doe) and “Mississippi”, or that include Torq or torq.
- You can also limit more of the search including limit of items, types of files, and more by opening the Manage Parameters icon.
Create folder
- Use the Access Token created in {{ $.create_session.api_object.access_token }}
- Configure the required step parameter.
- CREATE_FOLDER_NAME: Give the folder a unique and relevant name.
- CREATE_FOLDER_PARENT_ID: From your Search Content step, access the API object entries and the parent ID of the folder you would like to be the parent folder for your new item.
Set folder permissions
- Use the Access Token created in {{ $.create_session.api_object.access_token }}.
- Change the folder permissions to either "open" to allow the folder to be public, or "company" to restrict the folder to only enterprise members, or "collaborators" to allow for the folder to be shared.
- Change the download permissions to either "true" or "false" according to if you want the folder to be able to download links.
- For Folder ID, use the ID created in the create folder step {{ $.create_folder_1.api_object.id }}.
Get folder information
- Use the Access Token created in {{ $.create_session.api_object_access_token }}
- For Folder ID, use the ID created in {{ $.create_folder_1.api_object.id }} or {{ $.search_content.api_object.entries.0.parent.id }}
Update file
- Use the Access Token created in {{ $.create_session.api_object_access_token }}
- Access the file ID by visiting the file in the Box web application and copying the ID from the end of the URL.
- Paste the ID into the proper field.
- Change the desired file information by opening the parameter's icon. From there you can update the description and name.
Premade steps
- Create a folder
- Create a session
- Delete a file
- Delete a folder
- Get file information
- Get folder information
- Get users in the enterprise
- List items in a folder
- Lock a file
- Search content
- Set file permissions
- Set folder permissions
- Unlock a file
- Update a file
- Update a folder