Box is a secure web-based file-sharing service that helps your team to collaborate. You can create and edit documents with your colleagues in real time from anywhere and on any device.

You can use IBM App Connect to pass key data between Box and other apps – automatically, in real time. You can do so using configuration and data mapping without a need for coding, and can achieve a return on your investment in minutes/hours, not days/months.

This guide shows you how.

If you can’t find what you want, or have comments about the “how to” information, please either add comments to the bottom of this page or .

A business scenario

The challenge

Say you’re leading a team that’s working on a big project. There’s a lot to do, and your team is spread across several locations. So you’re using Box as your cloud-based online storage and collaboration platform, which helps your team to securely store, share, and manage all their files. With Box, the whole team can see the same set of files, and can change those files in real time from anywhere, on any device. So no sending copies of files as email attachments, and everyone always has the latest file version on hand, making collaboration seamless. But if your work is closely tied to work in other applications, it can be time-consuming to manually create folders in Box for that work. Wouldn’t it be great if the Box folders could be created automatically?

How App Connect can help

Use App Connect to connect additional apps to Box. So whenever a new campaign is created in Salesforce, for example, a folder is created in Box automatically, making your team more collaborative and saving time for other work.

What should I consider first?

Before you use App Connect Designer with Box, take note of the following considerations:

  • To create an integration flow that passes data between Box and other apps, you must connect App Connect to each app in the flow:
    • To connect App Connect to your Box account, you’ll need the email address and password for your Box account. When prompted, grant App Connect read and write access to the files and folders that are stored in Box.
    • To connect App Connect to other apps, see the How to page for that app.

    You can connect to an app either from the Applications tab on the App Connect Catalog page, or when you add an application to a flow. From the Applications tab, you can also see the list of supported events and actions for each app.

  • When you use the “Create file” action to add a file to Box, the following points apply:
    • You must specify a parent folder for the file that you want to create. This folder must already exist in Box, and can be selected from a pre-populated list of Box folders in your account.

      Create file fields for Box with folder selected

      If you want to specify a dynamic value (which is returned by a previous event or action) for a folder instead of a static value from the pre-populated list, you can switch to advanced mode to set this value. You’ll notice that the drop-down list is converted to a text box, which you can then use to map to a folder ID from a previous node.

      Specifying a dynamic value for a folder using advanced mode

    • If you don’t provide an extension for the file name, a text file (.txt) is created by default.
    • You must use the Type of file field to indicate whether the file content should be treated as plain text (Text), or whether base64 encoding (Binary) should be applied for file formats such as PDF, Microsoft Word, and so on.
  • When you use the “Create folder” action to create a Box folder, the folder will be created at the root level by default. This is indicated by the default value of 0 (zero) that is shown in the Parent ID field.

    Create folder fields for Box

    In the Box UI, you can find this ID in your root folder’s URL.

    Parent ID in a Box root folder's URL

    To specify a different parent folder for the folder being created, overwrite the default ID of 0 with a hardcoded value or a mapped value. The parent folder must already exist.

    • To obtain the hardcoded ID of a parent folder, open the folder in Box; the folder’s ID is shown as a sequence of numbers at the end of the URL in the browser address bar. For example, in the URL https://app.box.com/folder/31234567893, the folder ID is 31234567893.
    • If your flow contains a previous action that returns a folder ID (for example, a “Retrieve folders” action), you can also specify the parent ID as a mapped field.

      Parent ID field showing a mapped value

  • When retrieving or transferring the contents of a file, the maximum permitted file size is 10 MB if the file content needs to be parsed or transformed using JSONata functions. Otherwise, the maximum file size is 50 MB.

    For the “Create file” action, you can specify the file content by specifying text or by mapping to content from a previous node in the flow. If mapping to content, specify only a single mapped value, and do not append or prepend a string of text to the mapped value. Valid and invalid examples are shown in the following table.

    Valid examples Invalid examples

    Valid text value for creating a file in Box

    Valid mapped value for creating a file in Box

    Invalid prepended text

    Invalid appended text

    Invalid mapped values for creating a file in Box

Troubleshooting tips

When added to a flow, some Box actions will immediately make an API call to Box to retrieve the set of existing objects that the action can be performed on or against. For example, the “Create file” action makes an initial call to obtain the list of existing folders that you can create the file in. If you see a Not connected validation error when you add such actions, but do not see this error for other Box actions (which typically make a call only when the flow runs), this might be due to a broken connection between App Connect and Box.

'Not connected' validation error in Box

To confirm the cause, you can also check the App Connect on IBM Cloud logs for errors; for a broken connection, you might see an error such as this:

Request to https://firefly-actions-catalog-prod.appconnect.ibmcloud.com/api/connectors/configuration/box/CREATE/File/actions?apiConnectionID=a48a4c00-c5b0-11e9-a71f-c7543a2c72ec failed with status 401

To re-establish a broken connection, you must re-authorize your Box account by updating the connection details for that account, as described in Managing accounts in App Connect.

Example

Box tutorial flow in App Connect

Create an event-driven flow that copies a Wufoo attachment to Box

Learn how to use App Connect Designer to create an event-driven flow that copies a Wufoo file attachment in a submitted form and adds the file to Box.

2 comments on"How to use IBM App Connect with Box"

  1. Laurinda Alcorn March 03, 2018

    Why don’t I see IBM Connections on the list of Apps that can be connected from Box?

    My Team has a myriad of Box folders. Content has become difficult to find, and new members of the team are in trouble, finding the information they need because the weren’t present when a particular folder or document was first created/shared in Box. We have IBM Connections too. I want to set up a Community for my team on Connections that helps folks navigate the content/folders on Box, to locate necessary information (and avoid creating duplicate/redundant material.)

Join The Discussion

Your email address will not be published. Required fields are marked *