Tips and FAQ

Box - How to Troubleshoot Duplicated Event Issues

The Box element is currently supporting three types of events: Webhook V1 events, Webhook V2 events, and Polling events. By default, for all our higher environments our app configured for Webhooks V1.

Duplicated events can appear when multiple webhooks are involved and they catch the same event, while each is sending a notification. Here are the two possible cases and their solutions:

1. The Webhook 1 is enabled but also Webhook V2 through the Box element call POST/webhooks. In this case, the solution is to either delete v1 configuration from BOX UI or delete webhook v2 using our APIs.

2. The Box account used to create the instance is at fault for sending multiple events. In this case there could two different webhook applications set up in the concerned Box account and each application is generating an event. To solve the issue one of those applications should be disabled.

Box - How to Retrieve Files as a Collaborator

As a collaborator of a folder in Box, you have certain permissions to access a folder and all of its subfolders. With this structure, your path to retrieve files will be different than a regular user of the account.

For a regular user, suppose the path to retrieve a file would look like this:

/parent/folder1/folder2/folder3/test-file.pdf 

A collaborator that only has access to "folder2" will retrieve the file with this path:

/folder2/folder3/test-file.pdf

 

Box - What ID Can Be Used To Get The Root Folder of Documents Hub Elements?

We are in the process of normalizing the documents hub even further, but there are always a few unique API provider differences and the 'ID' used to make a GET by the root folder ID is one such difference.

Currently the following values can be used in these elements to make GET calls directly against the root folder by ID (for example, GET /folders/{id}/contents or GET /folders/{id}/metadata).

  • Box: 0. For example GET /folders/0/contents.
  • Dropbox: Double URL-encoded path: %252F. For example, GET /folders/%252F/contents.
  • Google Drive: root.  For example, GET /folders/root/contents.
  • OneDrive: root. For example, GET /folders/root/contents.
  • ShareFile: Whatever value was input at instance provision as the Sharefile root folder, such as top. For example, GET /folders/top/contents.

Box - How To Post Custom Fields

There is a specific order in which custom fields can be posted through API calls to files in Box. The following is an example using sample payload data that can be used as a reference when verifying the necessary API calls to make.

  1. GET /folders/content or utilize another API call to determine the file ID for an example file.
  2. GET /custom-fields/enterprise-templates

    or

    POST /custom-fields/templates  

    {
    "displayName": "Example Template",
    "fields": [
    {
    "description": "Custom Field Example",
    "displayName": "CustomField",
    "hidden": false,
    "key": "custom1",
    "type": "string"
    }
    ],
    "hidden": false,
    "scope": "enterprise",
    "templateKey": "customTemplate"
    }
    Note the template key
  3. POST /files/{id}/custom-fields/{templateKey}/templates
    {
    "scope": "enterprise"
    }
    Note: This will associate the customTemplate template with the selected file.
  4. POST /files/{id}/custom-fields
    {
    "path": "/custom1",
    "scope": "enterprise",
    "template": "customTemplate",
    "value": "Custom Field Value"
    }
    Note: this adds a custom field value to the template. The 'path' field in this POST must reference the fields.key from GET /custom-fields/enterprise-templates with a preceding forward slash.