Dropbox Egress Connector

Dropbox Egress Connector

Version: 17.07

Supported Since: 17.07

What is Dropbox Egress Connector?

Dropbox Connector can be used to perform Dropbox operations such as lookups, file management, sharing and upload/download. Each supported operation is provided as a pluggable connector operation which can be attached to the egress connector and configured in order to achieve the required functionality.

All operations are invoked via Dropbox REST API v2, using token-based authentication under a pre-configured Dropbox app. Hence in order to start using the connector, you need to have access to a Dropbox app (app key) and an access token obtained for a user on behalf of the app (authorizing the app to perform API operations on the user’s Dropbox account). Please also note that some operation variants, such as preparing password-protected shared links, requires premium apps and may not work with free apps. Further details of the operations can be found under the Dropbox REST API v2 documentation.

In order to use the Dropbox Egress Connector, you must first select the Dropbox Connector dependency from the connector list when you are creating an empty Ultra project. If you have already created a project, you can add the Dropbox Connector dependency via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list, select the Dropbox Connector dependency.
dropbox egress ports

Out Ports

On Exception

The message will be emitted from this out port if the Dropbox API call failed or returned an error

Response Processor

Result of the Dropbox API call (dependent on the nature of the operation) will be emitted from this port as a message. You can use this port to connect any precessing element or connector that is supposed to process/consume the result.

Side Ports

Connector Operation

This port must be used to connect the required Dropbox operational element to the Egress Connector.

Parameters

* marked fields are mandatory.

Client ID *

Basic

Client ID, or App Key, of the Dropbox app that will be used to access the Dropbox API. This field supports placeholder expressions.

Access Token *

Basic

Access Token for the Dropbox account. This token has to be obtained by authorizing the app indicated by Client ID against the required account; if you are accessing your own Dropbox account via your own Dropbox app, you can follow this guide to obtain a token for your own use. This field also supports placeholder expressions.

Retry Count

Advanced

Number of times to automatically retry a Dropbox API operation during failure scenarios. Set this to 0 (default) to disable auto-retry.

Locale

Advanced

The locale to be used for outbound requests (e.g. en_US). If unspecified, the default value will be the default locale of the ESB runtime (JVM).

Result as Payload

Extraction

If this is enabled, the message emitted from the egress connector will contain the result of the Dropbox API operation as its payload (useful in case you wish to analyze/perform further operations on the response). Note that this strictly refers to the Dropbox API response (e.g. not the downloaded content in case of a download operation; which has to be configured as a separate case).

Variable Name

Extraction

If Result as Payload is disabled, result of the Dropbox API operation will be persisted into a scope variable named after this field, of the emitted message.

Retain as Object

Extraction

If this is enabled, the response received from the API will be retained as a native Dropbox SDK entity (Java object) without being converted into JSON. Note that when this option is enabled, a custom processing element may need to be written if you need to analyze/process the API response, whereas in the other case the persisted JSON payload could be manipulated using the JSON processing elements.

Sample Use Case

Use case description

We shall look at a simple "Dropbox sync" flow that would sync content placed in a local folder into a remote Dropbox folder. Here we consider /home/john/dropbox/new as the local folder and /Sync as the remote Dropbox folder. In order to avoid possible repetitions, we shall move each successfully synced file to /home/john/dropbox/done, or to /home/john/dropbox/failed in case of a sync failure.

Implementation

Start by creating a new integration flow dropbox-sync. Select NIO File Connector and Dropbox Connector from the Component Registry.

Start the flow with a NIO File Ingress Connector, configured as follows, that will handle inbound files on /home/john/dropbox/new as described above:

NIO File Ingress Connector: Basic Configurations
NIO File Ingress Connector: Advanced Configurations

Next add a Dropbox Egress Connector and configure it by specifying the Client ID and Access Token values.

Now add a Upload File connector operation element to the side port of the above Dropbox connector, configured as follows:

Dropbox Upload File Connector Operation: Basic Configurations

Now add a Successful Flow End to signify that the message flow has completed successfully.

The complete flow would resemble the following:

Dropbox Egress Connector: Sample Configuration

After launching the flow, any files placed in /home/john/dropbox/new would be picked up (after a 3-second interval) and uploaded to a /Sync folder on Dropbox, with the same file name. Local copies of successfully uploaded files will be available at /home/john/dropbox/done whereas any failed files will be available at /home/john/dropbox/failed.

In this topic
In this topic
Contact Us