# Dropbox

## Authentication

Dropbox uses Oauth 2.0 to connect. This means that you will need to create an app in the [developer portal](https://www.dropbox.com/developers/apps) for Dropbox, and an authorized user for that app must complete the authentication in Middle.

{% stepper %}
{% step %}

### Create a new Dropbox app

Go to the Dropbox [App Console](https://www.dropbox.com/developers/apps) and complete the below steps:

1. Click **Create App**
2. Chooe the **API - Scope Access**
3. Choose **App Folder** **Access**
4. Click **Create App**

{% hint style="success" %}
App Folder Access allows the business to place all files the they want in the integration inside their app folder and keep the rest of their Dropbox separate
{% endhint %}

<figure><img src="/files/IN6ZZ1ItCfUHiw22Ew6O" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Add the re-direct URL for the Middle instance

Add `https://YOURINSTANCENAME.middle.app/oauth-redirect-uri/` to the **Redirect URIs** and click **Add**.

{% hint style="info" %}
If you have questions about your instance's name, please reach out to <support@middle.app>
{% endhint %}

{% hint style="success" %}
INTEGRATE customers should use the following: `https://integrate.middle.app/oauth-redirect-uri/`
{% endhint %}
{% endstep %}

{% step %}

### Choose app scopes

Navigate to the **Permissions** tab and ensure `file.contents.read` is checked. Hit **Submit** at the bottom to save changes.

<figure><img src="/files/tLgR8rpK9NHsHlSbrqxS" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Retrieve the app key and secret

1. Navigate to the **Settings** tab.
2. Scroll to the **App Key** and **App Secret** area
3. Provide these credentials securely to the Middle team

{% hint style="info" %}
We recommend using a service like [OneTimeSecret](https://onetimesecret.com/) to send secure credentials. There is no charge to use OneTimeSecret.
{% endhint %}
{% endstep %}

{% step %}

### Review your Dropbox folders

After this is set up, you should see a new folder in your Dropbox called **Apps**, and inside a folder for the new app you created.

<figure><img src="/files/fqqVedICsgoBB2FEsdWd" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Authenticate Dropbox in Middle

Once the API Key has been set up, **you will be able to authenticate Dropbox from your Middle account.**

1. By default, your authentication is connected to the root folder of the App Folder you've connected, meaning any files you drop in there would be selected. However, this integration is **not** recursive, meaning any folders within the App Folder will not be searched.
2. You *can optionally* add a subfolder as part of authenticating your Middle account. For folder content syncs, we would retrieve any files inside the folder you indicate.

   1. You will need to add the lower-case file path name for the folder.
   2. Ex: "/new folder" is the file path for the folder called "New Folder"
   3. You can come back and do this step later if needed - it's not required for initial authentication.

   <figure><img src="/files/Wy982wOwriL9vBz6rDgZ" alt=""><figcaption><p>Adding a new folder path via the Middle authentication</p></figcaption></figure>
3. Hit **Save**

<figure><img src="/files/k1h1qjctI7OXljXkP7u4" alt=""><figcaption><p>The new folder created by the Middle authnetication</p></figcaption></figure>
{% endstep %}

{% step %}

### Launch the OAuth flow

You will then see a screen like this:

<figure><img src="/files/pfzZ0U5SoUXzgZHKbAl4" alt=""><figcaption></figcaption></figure>

1. Ensure the correct API key is selected
2. Hit **Save**
3. Hit **Launch OAuth Flow** and authenticate with a user who either created or has developer access to the App created in the Dropbox App Console
   1. Sign in (if not already), and authorize the connection
   2. This should redirect you back to Middle with “oAuth Success”

{% hint style="info" %}
If you are not redirected to Middle please reach out to <support@middle.app>
{% endhint %}
{% endstep %}
{% endstepper %}

## Setup a Dropbox folder for email attachment receiving

You can setup a unique email address for your Dropbox folder to receive emails and store attachments as files.

To do this, use the **Email to Dropbox** app:

{% embed url="<https://www.dropbox.com/apps/email_to_my_dropbox>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.middle.app/middle-docs/guides/app-reference/dropbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
