Dropbox Cloud Connector

The Dropbox Cloud connector retrieves content from a Dropbox application and indexes it into Haven OnDemand. The connector connects to a Dropbox user account using a Dropbox application, and retrieves the files accessible to that Dropbox application.

This connector is a cloud connector that runs entirely in the Haven OnDemand environment.

Create a Dropbox Application

To index content from a Dropbox, you must first create a Dropbox application to represent the connector and obtain an access token so that the connector can authenticate with Dropbox.

Note: This procedure is subject to change. For information about creating a Dropbox application and obtaining an OAuth Token, refer to the Dropbox developer documentation.

To create a Dropbox application and generate an OAuth Token

  1. Create a Dropbox user account.
  2. Go to https://www.dropbox.com/developers/apps and click Create app.
  3. On the choose an API step, click Dropbox API.
  4. On the choose the type of access you need step, choose whether you want the app to provide full access to the connector, or access only to a single folder:

    • To provide access to a single folder and its subfolders, click App Folder. This will create a folder called Apps in your Dropbox root. Upload, copy or move any files you want to make accessible to the Connector, into this folder. If you choose this option, you must set the parameter full_dropbox_access to false in the connector configuration.
    • To allow the connector full access, click Full Dropbox.
  5. On the name your app step, type a name for your application.
  6. If this is your first time creating a Dropbox application, you must agree to the Dropbox API terms and conditions to continue.

    After you create the application, you will be redirected to the settings page.

  7. On the Settings page, find the App Key setting. Use this value as the value for the app_key parameter for your connector credentials configuration.
  8. In the OAuth 2.0 section of the settings page, click Generate to create the token. Use the generated token as the value of the access_token parameter for your connector credentials configuration.

    The generated access token does not expire. However, you can invalidate a previous token by generating a new token. In this case, you must use the Update Connector API to update the access_token parameter for the connector.

    Note: When you update the credentials with the Update Connector API, you must ensure that the connector reads the new credentials in its next run. To do this, you can set the invalidate_previous_state parameter to true in the Update Connector API, or you can set the ignore_previous_state parameter to true in the Start Connector API when you run the connector.

Dropbox_cloud Connector Configuration

The following table outlines the configuration options that you can set for the Dropbox_cloud connector flavor. You can use these in the JSON object that you pass to the config parameter in the Create Connector API.

Note: All the options are case sensitive.

Required Parameters

Parameter Type Description
full_dropbox_access Boolean Set this parameter to true if full access to Dropbox is granted for your Dropbox application. You can find the value for this parameter in your Dropbox application, on the settings page.

Example Configuration

{
	"full_dropbox_access": true
}

Dropbox_cloud Connector Destination

This section outlines the options that you can set for the destination that the connector indexes into. You can use these in the JSON object that you pass to the destination parameter in the Create Connector API.

Note: All the options are case sensitive.

Required Parameters

Parameter Type Description
action Enum The action to take when indexing documents. You can use the following options:
  • addtotextindex. Add documents directly to a Haven OnDemand text index.

Parameters for Add to Text Index Action

The following parameters are required in the destination JSON object when action is set to addtotextindex

Parameter Type Description
index String The name of the text index that you want to index documents into. This index must already exist in Haven OnDemand (created by the Create Text Index API).

Example Destination

{
	"action": "addtotextindex",
	"index": "testindex"
}

Dropbox_cloud Connector Schedule

This section outlines the options that you can set for the schedule that the connector runs on. You can use these in the JSON object that you pass to the schedule parameter in the Create Connector API.

Note: All the options are case sensitive.

Required Parameters

Parameter Type Description
frequency Object The frequency configuration that describes how often to run the connector.

The frequency object must contain the following parameter:

Parameter Type Description
frequency_type Enum The type of frequency configuration to use. This setting affects the other parameters that you must set in the frequency object. You can use one of the following values:
  • seconds. The connector frequency is set in seconds. You must also specify the interval parameter.

When you have set the frequency_type parameter to seconds, you must also set the following parameters:

Parameter Type Description
interval Integer The number of seconds between each connector run. This interval measures from the start of one connector run to the start of the next. The maximum interval is 31536000.
Note: The exact interval that the connector uses might vary by up to 30 minutes, depending on load on the system and the scheduler.

Optional Parameters

Parameter Type Description
occurrences Integer The number of times to attempt to schedule a connector run. If you do not set occurrences, the number of runs is unlimited. The schedule stops either after this number of runs, or when it reaches the configured end_date, whichever occurs first.
start_date String The date to start scheduling the connector. For a list of available date formats, see Date Formats for Parameters. If you do not set a start_date, the connector runs after the first interval elapses.
end_date String The date to stop scheduling the connector. For a list of available date formats, see Date Formats for Parameters. The schedule stops either after this date, or when it has run the number of times configured in occurrences, whichever occurs first.

Example Configuration

{
	"occurrences": 5,
	"start_date": "1",
	"end_date": "29/06/2015 12:00:00 -0600",
	"frequency": {
		"frequency_type": "seconds",
		"interval": 21600
	}
}

Schedule Errors

If an attempt to run a connector fails, for example because an error occurred on the system, the Connector Status and Connector History APIs return an error status in the response for the schedule. In this case, Haven OnDemand attempts to retry the connctor schedule up to three times. When a schedule fails, Haven OnDemand attempts to retry it the next time it scans the connector schedules (every minute).

If the schedule fails three times, Haven OnDemand stops the connector schedule. In this case, you must either use the Update Connector API to set a new schedule, or manually start the connector with the Start Connector API.

Dropbox_cloud Connector Credentials

This section outlines the options that you can use to set credentials for the connector. You can use these in the JSON object that you pass to the credentials parameter in the Create Connector API. The credentials parameter is required for Dropbox_cloud flavor connectors.

Note: All the options are case sensitive.

Required Parameters

Parameter Type Description
app_key String The application key value that the connector must use for the Dropbox application.
access_token String The OATH 2.0 access token that the connector must use for the Dropbox application.

Example Connector Credentials

{
	"app_key": "pyj8y7kql1ez18q",
	"access_token": "V0tugFx1svAAAAAAABBBF5hcrnWJbQ7X9FzwLsseQ2K9xP-KKHVhdxCJBGhKegxU"
}

Dropbox_cloud Connector Credentials Policy

This section outlines the options that you can use to set the credentials policy for the connector. The credentials policy options define when the system can decrypt credentials. You can use these parameters in the JSON object that you pass to the credentials_policy parameter in the Create Connector API. The credentials_policy parameter is required if you have set credentials.

The credentials policy controls how Haven OnDemand manages decryption tokens for storing and decrypting the credentials that the connector uses to access the repository. You can obtain a decryption token from the Start Connector and Retrieve Config APIs, which require the decryption of the connector credentials. Haven OnDemand sends the decryption token to an email address that you specify in the credentials policy.

The credentials policy also specifies how long the decryption token is valid for. If you send an invalid token to one of the APIs that requires it, the API automatically generates and sends a new token to the email.

The credentials policy has its own expiration date. After this time, you must renew the policy with the Update Connector API.

Note: All the options are case sensitive.

Required Parameters

Parameter Type Description
notification_email String The email address to which to send information about connector activity.

Optional Parameters

Parameter Type Description Default
token_expiration Integer The number of seconds that a generated token remains valid. The expiration time is counted from the moment the token was generated. Every generated token is valid for the specified duration, and can be used for decryption a number of times specified by token_occurrences. After the token_expiration time, the token cannot be used, even if it has not had token_occurrences uses. When the token expires, a new token is generated, resetting the token_expiration time and token_occurrences. The minimum value is 1. 1800
token_occurrences Integer The number of times that a generated token can be used for decryption. Every generated token is valid for this number of uses, and can be used for a duration specified by token_expiration. After it has been used token_occurrences times, the token cannot be used, even if the token_expiration time has not been reached. When the number of uses are exhausted, a new token is generated, resetting the token_expiration time and token_occurrences. The minimum value is 1. 1
key_expiration String The duration that the credentials policy is valid for. When the key expires, the Haven OnDemand key management service returns an error stating that the policy has expired. For a list of available date formats, see Date Formats for Parameters. 3 months
notification_email_frequency Enum The frequency to use to send information about connector activity to the notification_email address. You can use the following values:
  • always. Always send email notifications for all connector activity.
  • on_decrypt. Send email notifications only when an attempt to decrypt connector credentials occurs.
  • on_failure. Send email notifications only when a failure occurs when using connector credentials.
  • never. Never send email notifications.
on_decrypt

Example Credentials Policy

{
	"notification_email": "test@example.com",
	"notification_email_frequency": "always",
	"key_expiration": "19/06/2015 11:25:00",
	"token_expiration": 3600,
	"token_occurrences": 10
}

Dropbox_cloud Connector Limits

The Dropbox Cloud Flavor Connector has the following limits:

Schedule

Property Max Limit
interval 31536000

Static_resource_unit_cost

It costs 1 static resource unit to create a dropbox_cloud flavor connector.

Start_connector_unit_cost

It costs 5 start connector units to start a dropbox_cloud flavor connector.