Chapter 6. Connecting to Box

In an integration, you can download files from Box or upload files to Box.

A connection to Box cannot start a simple integration. In other words, you cannot use a Box connection to trigger integration execution.

The following topics provide the details:

6.1. Registering Fuse Online as a Box client

You must register your Fuse Online environment as a client application that can access Box. This lets you create any number of integrations that connect to Box. In other words, you need to register a particular Fuse Online environment with Box only once.

In each Fuse Online environment, there can be only one registration of Fuse Online as a Box client application. However, while each Box connection uses the same registration, it can use different user credentials.

Prerequisites

Procedure

  1. In Fuse Online:

    1. In the left panel, click Settings.
    2. On the Settings page, near the top, to the right of the callback URL, click Copy Callback URL to copy the callback URL for your Fuse Online environment to the clipboard. You will need this URL toward the end of this procedure.
  2. In another browser tab, go to the Box developer portal at https://app.box.com/developers/console and do the following:

    1. Sign in.
    2. Click Create New App.
    3. Click Custom App and then Next.
    4. For Authentication Method, click Standard OAuth 2.0 (User Authentication) and then Next.
    5. Enter an app name, for example, Fuse Online Client and click Create App.
    6. Click View Your App.
    7. Optional. In the OAuth 2.0 Credentials section, copy the client ID and the client secret to a safe location. These values are needed to create a connection to Box.
    8. Click Save Changes.

Result

Your Fuse Online environment is now registered as a Box client, which means that Fuse Online can access content in the Box account that you signed into.

6.2. Creating a Box connection

In an integration, to download or upload Box files, create a Box connection, which you can add to an integration. You can add the same connection to any number of integrations.

Prerequisites

  • There is a Box client application that registers your Fuse Online environment as an application that can access Box.
  • You can log in to the Box developer account that created that application, or you have the Box client ID and Box client secret for that application.
  • You know the user name and password for the Box account that you want this connection to use to access Box.

Procedure

  1. If you already have the Box client ID and the client secret, skip to the next step. Otherwise, to obtain those values, in a new browser tab, go to https://app.box.com/developers/console and do the following:

    1. Sign in to the Box account in which you created the app that registers access to Box from your Fuse Online environment.
    2. On the My Apps page, click the Fuse Online app to display its settings.
    3. On the left, click Configuration.
    4. In the OAuth 2.0 Credentials section, copy the client ID to the clipboard.
  2. In a different browser tab, in Fuse Online:

    1. Click Connections.
    2. Click Create Connection.
    3. Click the Box connector.
    4. In the User name field, enter the user name for the Box account that you want this connection to use to download or upload Box files.
    5. In the User password field, enter the password for that account.
    6. In the Client ID field, paste the Box client ID.
  3. Optional. If you need to, go back to the OAuth 2.0 Credentials for the Box app, copy the client secret to the clipboard and then return to Fuse Online.
  4. In the Client secret field, paste the Box client secret string.
  5. Click Validate. Fuse Online displays a message that indicates whether it can validate this connection. If validation fails, try again and be sure to enter the correct values.
  6. When validation is successful, click Next.
  7. In the Name field, enter your choice of a name that helps you distinguish this connection from any other connections. For example, enter Box Sales Account.
  8. In the Description field, optionally enter any information that is helpful to know about this connection. For example, enter Sample Box connection that can access content in our company sales Box account.
  9. Click Save to see that the connection you created is now available. If you entered the example name, you would see that Box Sales Account appears as a connection that you can choose to add to an integration.

6.3. Downloading or uploading a Box file in the middle of an integration

To download a file from Box, or upload a file to Box in the middle of a flow, add a Box connection to the middle of the flow.

Prerequisites

  • You created a Box connection.
  • You are creating or editing a flow and Fuse Online is prompting you to add to the integration.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection.
  2. Click the Box connection that you want the integration to use.
  3. On the Choose an action page, select one of the following:

    • Download to obtain a file from the Box account that this connection accesses.
    • Upload to upload a file to the Box account that this connection accesses.
  4. Configure the action you selected.

    To download a file:

    1. In the File encoding field, accept UTF-8 or specify the encoding for the file that you want the connection to obtain.
    2. Optional. In the File ID field, specify the Box ID for the file that you want to obtain. The file ID is at the end of the URL when you are viewing the file in Box. For example, in this URL: https://app.box.com/file/537364588548, the file ID is 537364588548.

      Alternatively, you can add a data mapper step before this connection and map the file ID from a previous step to this connection.

      In this release, you can download only a single file. However, mapping the file ID from a previous step can make identification of the file dynamic, for example, the ID can come from a database table. This means each execution might download a different file.

    To upload a file:

    1. In the Parent folder ID field, enter the ID of the Box folder to upload the file to.

      Box folder IDs are at the end of the URL when you view the content of a folder in Box. In this example: https://app.box.com/folder/89490291417, the folder ID is 89490291417. In this release, you can upload only a single file.

    2. Optional. In the File name field, enter the name for a new file. If you specify the name of a file that is already in the specified Box folder, the connection overwrites the file that is in the folder.

      The input to the connection must be a file that you want to upload to Box. If you do not specify a file name, the connection uploads a file that has the same name as the input file to the connection as long as a file with that name is not already present.

    3. Click Next to specify the upload action’s input type.
    4. In the Select Type field, accept Type specification not required and click Next.

Result

The connection appears in the integration flow where you added it.

6.4. Uploading files to Box to finish an integration

To finish an integration by uploading files to Box, add a Box connection as the integration’s finish connection.

Prerequisites

  • You created a Box connection.
  • You are creating or editing a simple integration and Fuse Online is prompting you to choose the finish connection.

Procedure

  1. On the Choose a connection page, click the Box connection that you want to use to finish the integration.
  2. On the Choose an action page, select the Upload action to upload a file to the Box account that this connection accesses.
  3. In the Parent folder ID field, enter the ID of the Box folder to upload the file to.

    Box folder IDs are at the end of the URL when you select a folder in Box. In this example: https://app.box.com/folder/89490291417, the folder ID is 89490291417. In this release, you can upload only a single file.

  4. Optional. In the File name field, enter the name for a new file or an existing file. If you specify the name of a file that is already in the specified Box folder, the connection overwrites the file that is in the folder.

    The input to the connection must be a file that you want to upload to Box. If you do not specify a file name, the connection uploads a file that has the same name as the input file to the connection.

  5. Click Next.
  6. In the Select Type field, accept Type specification not required and click Next.

Result

The connection appears at the end of the integration visualization.