Box is a cloud storage service provided by Box Inc. It allows users to create and use shared folders for personal use or for use by multiple people. It is also possible to perform various operations using APIs.
Questetra BPM Suite provides built-in automations that are packages of complex code for sending API requests and can be easily configured.

This article explains how to share files with people outside the company using those built-in automations that work with Box.

For more information about Box, please visit the official Box help page.

Built-in Auto Steps

Questetra has a number of built-in auto steps that work with Box. In this issue, we will cover five of them: [Create Folder], [Apply Watermark to Folder], [Upload File], [Create Shared Link to Folder], and [Delete Folder].

Questetra:Auto Steps that work with Box

  First, a brief description of the auto steps used in this project is given below.

Box: Create Folder

Specifies a folder on Box and creates a new folder in it. If no folder is specified, the upload will be made to the uploading user’s root folder. The ID and URL of the created folder can be saved in a Data Item.

Box: Apply Watermark to Folder

Specifies a folder on Box to apply a digital watermark to that folder. When watermarking is enabled for a folder, the files stored in that folder will be watermarked. Files newly uploaded to the folder will also be watermarked in the same way.
What is a Box electronic watermark?

Electronic watermarks are provided as one of Box’s services (available with Box’s Enterprise account).

The Box platform allows users with administrative privileges to enable electronic watermarks on files and folders. When watermarking is enabled, the viewer’s information and access time will be superimposed over the entire contents of the file as a semi-transparent string in the preview of the individual file. (Viewer information is the Box registered email address if the visitor is logged in to Box, or the IP address if the visitor is not logged in).

When a file or folder in this state is shared with an external party, the information of the viewer is displayed as a watermark, which deters the user with whom the file was shared from modifying or redistributing the file (external leakage).

Box Support: Watermarking Files

Box: Upload File

Uploads a file to Box. The file to be uploaded is specified by a File-type Data Item. Multiple files can be uploaded at the same time by setting multiple files in a Data Item. The destination folder for the upload is specified by the folder ID, and if not specified, the file will be uploaded to the root folder of the user uploading the file. IDs and URLs of uploaded files can be stored in Data Items.

Box: Create Shared Link to File

Specifies the folder you want to share on Box and generates a shared link. By adding Data Items, an expiration date and password can be set.

Box: Delete Folder

Specifies and deletes a folder on Box. Multiple folders can be deleted at once by specifying a multi-line String-type Data Item. In this case, one ID should be written per line.

Box and Questetra Integration Settings

In order to use an auto step that works with Box, it is necessary to obtain an OAuth token from Box in advance. The process of obtaining a token requires authentication and authorization with your Box account. Please follow the steps below to obtain a token.

On the Box service task settings screen, select the [Set up Settings] button under “C1: OAuth2 Setting”.

Next, click the Add button, enter an appropriate name in the Name field, and click Add. It is recommended that you use your Box account name as the connection name so that it is easy to identify which account is being used.

When you select “Get Token,” a login screen for your Box account will appear. (However, if you are already logged in to Box on your browser, you will only see the “Allow access to Box” screen.)

Enter your Box account (email address) and password, log in, and click “Allow Box access”.

If the authentication is successful, you will be returned to Questetra’s OAuth2 configuration page, and “o (Refresh Token)” will appear in the “Token Availability” field.

Return to the Questetra settings screen, select and specify the OAuth2 setting name added in “C1: OAuth2 Settings”, and the linkage settings will be complete.

If the Box account that performs authentication does not have the appropriate permissions, the auto step will fail. For example, if you do not have permission to create folders, the folder creation process will fail. Please check with your Box administrator to see if you are authorized to do so.

Sample App

Sample App created using automated processes

This application is designed to send files to people outside the company by uploading them to a dedicated folder created in Box and then sharing that folder. The URL of the folder is communicated to people outside the company via an email sent by an auto step. The folder (and the files in it) will be deleted three days after it is created. This is used when you send multiple files or files too large to send by email.
You can also choose to apply an electronic watermark to the files in the folder.

Data Items

Data Item NameData TypeField NameRequiredFile attachment processDescription
TitleEditableProcess Subject.
ID of the folder to be sharedString-type (single line)q_folder_idNo DisplaySave the ID of the folder created in the Create Folder step.
Shared Link URLString-type (single line)q_folder_urlNo DisplaySave the shared URL of the folder created in the Create Shared Link to Folder step.
Files to shareFile-typeq_fileEditableAdd files to be uploaded and shared.
Apply watermarkSelect-type (radio button)q_watermarkEditableSet two options: “Do not apply” and “Apply watermark”. Set “Apply watermark” as the default value.
Shared addressString-type (multiple lines)q_addressEditableEnter the email address of the person you wish to share with. When specifying multiple addresses, please start a new line for each address.
Email subjectString-type (single line)q_mail_subjectEditableEnter the string that will be set in the subject line of the outgoing mail.
Email bodyString-type (multiple lines)q_mail_bodyEditableSet Initial Value to something like “The file has been shared. Please access the folder below.”
Data Item Settings

Create Folder step

First, register the files to be shared and the email addresses of the recipients in the Attach File step. You can also edit the subject and body of the outgoing email.
In the following Create Folder step (see Box: Create Folder), you will create a folder on Box for sharing.

Item NameRequiredDescription
C1: OAuth2 SettingSpecify the OAuth2 setting to be used to connect to Box. The OAuth2 settings you specify must have a token obtained in advance (see “Box and Questetra Integration Settings”).
C2: Parent Folder IDUse the ID to specify in which folder the new folder will be created. Let’s leave it blank this time and specify the root folder.
C3: Folder name to createSpecify the name of the folder to be created. In this case, let’s use “#{processInstanceId}“. The “#{processInstanceId}” part contains the Process ID, so there will be no duplication with other folders created by this application.
C4: Data Item that will save Folder IDSpecify the Data Item to which the generated folder ID will be saved. In this case, specify the ID of the folder to be shared.
C5: Data Item that will save Folder URLSpecify the Data Item to which the URL of the generated folder will be saved. This time, it is not specified.
Box: Create Folder」Settings

Apply Watermark to Folder step

Set the XOR gateway “Watermark” to proceed to the “Apply Watermark to Folder” step if “Apply” is selected for the Select-type Data Item “Apply Watermark”.

The “Apply Watermark to Folder” step enables watermarking in the specified Box folder settings. Files uploaded to the target folder will have the digital watermark applied. If “Do not apply” is selected, this step will be skipped.

Item NameRequiredDescription
C1: OAuth2 SettingsSpecify OAuth2 settings to be used for connection to Box. The OAuth2 settings you specify require a token to be obtained in advance (see “Box and Questetra Integration Settings”).
C2: Folder ID to apply watermark toSpecify the Data Item “ID of the folder to be shared” whose folder ID was saved in the “Create Folder” sterp.
Box: Apply Watermark to Folder Settings
In the “Update Data” step immediately after [Box: Apply Watermark to Folder], the following note is added when the watermark is applied to the email body.

#{#q_Email_Body}
You must be logged in to your Box account to download files.
If you do not have an account, please go to “Sign Up” to create a free account.

Upload File step

The “Upload File” step uploads the registered files to the folder where they were created.

Item NameRequiredDescription
C1: OAuth2 SettingsSpecify OAuth2 settings to be used for connection to Box. The OAuth2 settings you specify must have a token obtained in advance (see “Box and Questetra Integration Settings”).
C2: File type data item whose attached files will be uploadedSpecify the Data Item “Files to share” that contains the file to be uploaded.
C3: Folder ID that file will be uploaded (Root folder if blank)Specify the ID of the folder where the uploaded file will be saved. If you select “ID of the folder to be shared” from “Insert reference…”, #{#q_folder_id} will be inserted.
C4: String type data item that will save uploaded file idsSpecify the Data Item to which the ID of the uploaded file will be saved. Not used in this case.
C5: String type data item that will save uploaded file urlsSpecify the Data Item to which the URL of the uploaded file will be saved. Not used in this case.
Box: Upload File Settings

Create Shared Link to Folder step

After the file upload is complete, proceed to the “Create Shared Link to Folder” process. A shared link to the ID of the folder created here will be generated.

Item NameRequiredDescription
C1: OAuth2 SettingsSpecify OAuth2 settings to be used for connection to Box. The OAuth2 settings you specify must have a token obtained in advance (see “Box and Questetra Integration Settings”).
C2: Folder ID to shareSpecify the ID of the folder to be shared. If you select “ID of the folder to be shared” from “Insert reference…”, #{#q_folder_id} will be inserted
C3: Data item with Expiration of the LinkSpecify the expiration date of the shared link with a Date-type Data Item. Not used in this case.
C4: Data item with Password of the LinkSpecify the password for the shared link as a String-type Data Item. Not used in this case.
C5: Data item that will save web the Shared Link*Specify the Data Item to which the created shared link will be saved. In this case, specify “Shared Link URL”.
Box: Create Shared Link to Folder Settings
As of 2022-10-28, due to Box specifications, if you set a password when sharing a file/folder with watermarking applied, the sharers will not be able to download/preview the file.

“URL Announcement” Event

Once the sharing settings are complete, proceed to the “URL Announcement” process, which is an intermediate event in sending the message. Here, the URL in the “Shared Link URL” is communicated to the recipient.

Item NameDescription
SenderThe string to be displayed in the FROM field of the incoming mail. If blank, Questetra BPM Suite will be displayed.
ToSpecify the email address to be shared. Select “Shared address” from “Insert reference…” to insert #{#q_address}.
Cc
Bcc
Set the address as needed.
BodyUse the “Insert reference…” button to specify

(#{#q_email_body})
Folder ID:#{#q_folder_id}
Access URL:#{#q_folder_url}


In addition, use an expression to display the deletion date of the folder

Specify that the data will be deleted in #{#dateFormatter.format("yyyy-MM-dd", #now.addDays(3))}
Throwing Message Intermediate Event Settings

Timer Event

Once the email is sent, proceed to the Timer Intermediate Event.

Item NameDescription
Datetime specified by Data ItemSpecify the date and time to proceed with the next step in the Data Item. Not used in this case.
Datetime specified by an expressionSpecify the date and time to move on to the next step with an expression. In this case, we choose this one and the expression is “#now.addDays(3)“.
Timer Intermediate Event Settings

This will allow them to wait up to three days after you start the process. Please make sure that the recipient receives the file during this time, for example, by annotating it in the announcement email.

※ Related Manual: M223: Automatically Sleep for a Specified Period During A Process

Delete Folder step

After 3 days, the folder will be deleted by proceeding to the “Delete Folder” step (see “Box: Delete Folder”).

Item NameRequiredDescription
C1: OAuth2 SettingSpecify the OAuth2 setting to be used to connect to Box. The OAuth2 settings you specify require a token to be obtained in advance (see Box and Questetra Integration Settings).
C2: Data Item with Folder IDs to deleteSpecify the Data Item that contains the ID of the folder to be deleted. In this case, specify the ID of the folder to be shared.
Box: Delete Folder Settings

Once the folder is deleted, the entire process is complete.

Cases in which Electronic Watermarking is Used

As mentioned above, electronic watermarking provides increased security for files that are shared, but care must be taken when using it.

First, anyone with the shared link URL can access the folder, but they will only be able to view the list of files and the preview screen of individual files. If you have a Box account and are logged in, you will be able to download the files with the watermark (you will see a Login button on the preview screen).
If you do not have a Box account, you can create one by clicking the Sign Up button.

The downloaded watermarked document will be in PDF format and will not have any textual information, so you will not be able to copy or modify its contents.

Thus, when an electronic watermark is applied, the shared files are restricted and should be used in cases of notification or confirmation of document contents.

On the other hand, if you are sharing a file that is to be used or edited by the other party, please share it without applying an electronic watermark. For example, you may want to use a logo image, or edit (or have someone edit) a file for a presentation.

%d bloggers like this: