Box

Content under development

Box Service

This service allows you to integrate your Flows with Box.

Installing the Application Service

Intro

Information about how to install the service
You will need a box account, and install these app following the link
– https://app.box.com/services/manywho

For some functionality (as metadata and webhooks) it is needed to authorise server-to-server app, click in Bussiness Settigns, and then in the tab Apps, in the section Custom Applications click in Authorize New App. Ore follow this link (https://app.box.com/master/settings/openbox)

Insert the Api Key y86x8rnhjb4x4n659vqo9h15jg1bu0o2 and click in Authorize

The app https://app.box.com/services/manywho_server-to-server will be authorised after these steps

Features

Name Description
Identity This service supports the ability to log into Flows using Box
Database This service supports loading and saving data from Box
Files This service supports uploading, listing and deleting files
Logic This service contains various [[message actions|Actions]]
Listening *This service supports [[listening to objects|Listening]]
  • is supported only in the upcoming box service v3, and it won’t work with v1 or v2.

Configuration

When installing the Service, you should use the following settings:

Connection Uri

This service doesn’t have a production url yet, but you can check how it works using the staging url

https://services-staging.manywho.com/api/box/3

Configuration Values

Name Type Required Description
Enterprise Id String You need to get this value from the box Admin Console.

Types

The following Types are available for this Service. The Database column indicates if the Type can be Saved, Loaded, or Deleted using the Service. The Listening column indicates if Objects of this Type can be listened to.

Name Description Database Listening
File Representation of a file in box
Folder Representation of a folder in box
Task Representation of a task in box
Comment Representation of a Comment in box

Actions

Some helpful summary information about the various Actions that can be performed.

File: Copy

Use this action to copy a file into another folder, with an optional new name

Inputs

Name Type Required Description
Source File File Object Description of the action.
Destination Folder Folder Object Description of the action.
Name String Optional name for the file in the new destination.
File: Move

Move a file into another folder, with an optional new name

Inputs

Name Type Required Description
Source File File Object Description of the action.
Destination Folder Object Folder Description of the action.
Name String Optional name for the file in the new destination.
Folder: Create

Create a new folder

Inputs

Name Type Required Description
Parent Folder Folder Object In which folder is going to be created the new folder.
Name String Name for the new folder.

Outputs

Name Type Description
Folder Object Folder The new created folder
Task: Add Assignment

Use this action to do assign a task to an user by email

Inputs

Name Type Required Description
Task Task Object Description of the action.
Assignee Email String Email of the user who is assigned to this task.
Task: Create

Use this action to create a task for a file.

Inputs

Name Type Required Description
File File Object Description of the action.
Message String Description of the task.
Due At DateTime Due date of the task.

Outputs

Name Type Description
Task Task Object The new created task.

Code

You can access the source code and developer details about implementation on GitHub.

GitHub

https://github.com/manywho/service-box

How Tos

Some helpful how tos about this service.

Listening

This page is written for the upcoming box service v3, and it won’t work with v1 or v2.

As part of an executing Flow, it can sometimes be useful to wait for a particular object to be updated.

Configuring your Flow

There’s nothing specific about a Flow that can listen to Box objects. Listening can happen at any point, however, Listening is only supported in the following Elements:

  • Database Load: Load a object from Box and listen to any changes to it.
  • Database Save: Save a new object into box.
  • Message: Based on a previously loaded object from Box, listen to any changes to it.
  • Page: Based on a previously loaded object from Box, listen to any changes to it.

It’s important to note that you can only listen to records at the point to register the “listener”. Once the Flow proceeds to the next step, it is no longer listening to any further updates.

To add a listener to one of the above elements, you need to add the following JSON to the Map Element:

Where the properties are as follows:

Property Type Description
developerName String A memorable name for this listener so you can identify it easily in your Flow model.
serviceElementId String: GUID The unique identifier for the Box Service in your tenant. You can get this by querying the Service API (api/draw/1/element/service?filter=) and locating the “id” property of the Box Service.
listenerType String Please check list below.
valueElementToReferenceForListeningId String: GUID The unique identifier for the object Value loaded from Box. In order for the listener to work, you must have first populated an object Value from Box. You can then use this at any time to listen to that object. You can get the list of Values in your tenant by querying the Value API (api/draw/1/element/value?filter=substringof(developername, ‘the name of my value’) and locating the “id” property of the appropriate Value.
attributes Key/Value pairs Additional attributes that can help the Service make decisions about how best to execute the listener. This allows developers to extend our metadata as needed.

Supported listeners:

Listening to a file:

  • FILE.UPLOADED
  • FILE.CREATED
  • FILE.PREVIEWED
  • FILE.DOWNLOADED
  • FILE.TRASHED
  • FILE.DELETED
  • FILE.RESTORED
  • FILE.VERSION_RESTORED
  • FILE.COPIED
  • FILE.MOVED
  • FILE.RENAMED
  • FILE.LOCKED
  • FILE.UNLOCKED
  • FILE.SHARED
  • FILE.UNSHARED
  • FILE.SHARE_UPDATED

Listening to a folder:

  • FOLDER.CREATED
  • FOLDER.DOWNLOADED
  • FOLDER.RESTORED
  • FOLDER.DELETED
  • FOLDER.COPIED
  • FOLDER.MOVED
Metadata (Beta)

Metadata functionality is currently in beta at box, and can change in the future.

Create a template in box

You can list all your available templates or create a new one from the Admin Console in the section Work processes

Update the service

After you update the service you will notice that your template is available as a Type and the name will look like “Metadata: name_of_your_template”

Load metadata

You can use filters for load the metadata.

A Metadata object can not be filter by unique identifier

Launch a ManyWho Flow from Box

This page is written for the upcoming box service v3, and it won’t work with v1 or v2.

Add a ManyWho Flow as a listener

This process allow you to add a flow as a listener for the new box webhooks v2.

Create a new metadata (https://app.box.com/master/metadata/templates)
Use a descriptive name for the new metadata (e.g. Send File to Support) and set the status as visible.

Create a new attribute with format Dropdown with name ManyWho Flow Uri (this will be the flow that will be executed, you can add an input webhook-target-type and webhook-target-id to have more information about the item that trigger the flow ).

  • in the options type the flow uri for the flow that you would like to run

your ManyWho Flow Uri should look like this:
https://flow.manywho.com/67204d5c-6022-474d-8f80-0d576b43d02d/play/default?flow-id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&flow-version-id=yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy

Create a new attribute with format Dropdown with name ManyWho Flow Trigger

  • in the options type the the trigger for the file (e.g. FILE.DOWNLOADED)

Click in save

Assign a Metadata Execution Flow to a file

Click in the file that you want to initialize the flow, click in info tab and select the Metadata Execution Flow (it is not needed to select ManyWho Flow Uri) close the file.

Execute the flow defined in the file

Click in the file that have a Metadata Execution Flow assigned (e.g. Send File to Support), click in the three point link and then in the sub-menu More Actions select Launch ManyWho Flow.

Run the flow without use of webhooks

If you need to run directly the flow without the use of webhooks you can do exactly the same as above but without create the ManyWho Flow Trigger in the metadata.
This will execute the flow but without create any trigger in box.