# Dropbox Integration

### Dropbox

**Dropbox Integration Overview**: Dropbox REST API based integration. ([Documentation Link](https://www.dropbox.com/developers/documentation/http/documentation))

---

**⚠️ Proxy Configuration:** If your server accesses the internet through a proxy, make sure to whitelist the following domains for DropBox Authentication and storage access: **api.dropboxapi.com**

---

**⚠️ Restrictions**:\
• **No Resume Support for Uploads**: The Dropbox REST API does not natively support resumable uploads for partially transferred files in a way that is compatible with CrushFTP’s integration capabilities.\
• **No Support for MDTM (File Modification Time) Changes**: The API does not allow direct modification of a file’s metadata, including the file modification time (mdtm). When files are created or updated, the modification time is automatically managed by Dropbox.

---

Generate an **API Key** using the **Dropbox Developer Portal**: [Dropbox My apps Link](https://www.dropbox.com/developers/apps?_tk=pilot_lp&_ad=topbar4&_camp=myapps)

Click on the **Create App** button:\
**1.)** Choose the appropriate API.\
**2.)** Choose the type of access:\
\- Full Dropbox (access to the entire Dropbox)\
\- App Folder (access only to an app-specific folder)\
**3.)** Name your app and click Create App.\
**4.)** Once the app is created, you’ll be redirected to the app settings page.\
**5.)** Under the Settings tab, you’ll find your App key (API key) and App secret.

⚠️ The **Redirect URL** must be added in the following format:

```
 https://www.your.crushftp.com/?command=register_dropbox_api
```

It is important that the URL ends with **?command=register_dropbox_api**, as required by the Dropbox integration process.

---

**⚠️ Note:** For [CrushOIDC](CrushOIDC.md) Plugin the **Redirect URL** must be added in the following format:

```
https://www.your.crushftp.com/SSO_OIDC/
```

It is important that the URL ends with **/SSO_OIDC/**, as required by the [CrushOIDC](CrushOIDC.md) integration.

---

![Dropbox api registration](Dropbox-Integration/dropbox_api_registration.png)

⚠️ Grant **Permissions** for **Your Dropbox API** Key. Click **Submit** to save your changes.\
![attachmentsApp permis](Dropbox-Integration/dropbox_permissions.png)

![Personal account permissions](Dropbox-Integration/personal_account_permissions.png)

---

**Dropbox Business Account:**

Grant the necessary permissions for team folders.\
**⚠️ Important**:

- Only users with the **Team Admin** role can configure these settings.
- The **members.read** permission is required for Dropbox Business accounts.

![Business acount team permissions](Dropbox-Integration/business_acount_team_permissions.png)

---

**DropBox Remote [VFS](VFS.md) settings**:

Select the **DropBox** item type and click the **Get Access Token** button.

![Dropbox vfs before setup](Dropbox-Integration/dropbox_vfs_before_setup.png)

**⚠️ Important**: To obtain the **Refresh Token**, the CrushFTP WebInterface’s host and port must match the **Redirect URL** specified in the **Dropbox Developer Portal**. In our example, it was: **https<!-- -->://your.crushftp.domain.com/**

Enter the **App Key** , **App Secret**. Proceed with the authentication and authorization process.\
**⚠️ Important**: Be sure to sign in with the **Dropbox Account** that has the **necessary permissions**, as configured in the **Dropbox Developer Portal** (mentioned above). This will automatically configure the **User name** and **Password**.

![Dropbox app Key app Secret form](Dropbox-Integration/dropbox_appKey_appSecret_form.png)

Grant access to CrushFTP in the form that appears after authentication. Review the requested permissions and click **Allow** (or the equivalent button) to authorize CrushFTP to access the necessary resources.

![Dropbox allow app](Dropbox-Integration/dropbox_allow_app.png)

This will automatically configure the **User name** and **Password**:\
![Dropbox vfs registration finish](Dropbox-Integration/dropbox_vfs_registration_finish.png)

**⚠️ Dropbox Business Accounts**:\
**Dropbox Business User Email**: Enter the **email address of the team member** associated with the Dropbox Business account. All Team Folders will be accessed on behalf of this user.
