Dropbox Integration

Uploads from the Dropbox API support the following types of files:

All file types are selectable. This includes audio, video, image, text, office, and compressed archive files.

Section Quick Jump:

API OAUTH Webhooks

Using the Dropbox API

  1. User selects Dropbox from services list
  2. user authenticates connection by logging into Dropbox account
  3. user is connected and can select files from Dropbox in Filestack dialog

Dropbox api upload widget

Upload from Dropbox

Uploading or "picking" a file from Dropbox in the context of Filestack means choosing a file and creating a distributable link to that file after that file is copied to a new storage location.

Sample Upload Code
client.pick({ fromSources: ['dropbox'], }).then(result => { console.log(JSON.stringify(result.filesUploaded)) })

Create your own Dropbox OAuth application to Connect to Filestack:

In order to use Dropbox with Filestack, we require that you have your own custom Dropbox application and that you enter your Dropbox application's API keys in your Filestack Developer Portal.

Setting up a Custom Dropbox oauth application

  1. Go to https://www.dropbox.com/login
  2. Login to the Dropbox account you would like to associate Filestack with.
  3. On https://www.dropbox.com/developers click My Apps
  4. Click “Create App”.
  5. Select the Dropbox API
  6. Select Full Dropbox
  7. Name your App, and Click “Create App”
  8. On the next page, it will show the newly created app with an App key and App secret. The permission type should be Full Dropbox.
    You must set the following redirect uris for your application:
    • https://www.filestackapi.com/api/client/dropbox/authCallback/open
    • https://www.filestackapi.com/api/client/dropbox/authCallback/saveas
    Important! Once everything is working as expected, be sure to click the "Enable Additional Users" button and then the "Apply for Production" button to have your app approved by Dropbox and enable up to 100 users while you wait for approval.
  9. Navigate to the Developer Portal in Filestack and under the Credentials Section, click Dropbox Auth.
  10. Check the checkbox and copy and paste the App key and App secret into the corresponding fields. Click Save.

Congratulations! You have successfully connected Filestack with Dropbox using oauth.

Dropbox Webhooks for Your Application

Dropbox Webhooks serve the purpose of notifying users about events that occur in relation to their Filestack account. In your developer portal, you can set one or many urls whose purpose is to receive the messages triggered by specific Filestack events.

These are the three event types that will send messages to your webhook url(s) concerning Dropbox:

  • Dropbox File Uploads
  • Dropbox File Exports
  • Dropbox File Conversions

Configuring Dropbox Webhooks

Filestack Webhooks are configured in the developer portal under Credentials > Webhooks. If you enter your url and select "All", then one entry will be made for each type of Filestack Webhook Event, including the ones for Dropbox. To learn more about configuring and receiving webhooks please visit our main webhooks documentation page.

Receiving a Dropbox Webhook Notification

Configuring your server to receive a new webhook is the same as creating any page on your website. If you are using Sinatra, add a new route with the desired URL. In PHP you could create a new .php file on your server. It doesn't need to be complicated. With webhooks, your server is the server receiving the request. You can even use an external service such as RequestBin as shown in the screenshot above.

Webhook data is sent as JSON in the request's body. The full event details are included and can be used directly. The "action" in the JSON is the type of Filestack event that happened, be it a file being uploaded, or simply the Filestack dialog opening.

Filestack will retry sending a webhook 3 times if the first attempt fails. The second attempt to deliver a webhook happens 5 minutes after the first attempt, the third attempt happens after 1 hour, and the final attempt to deliver a webhook happens 12 hours after the first attempt.

Note that for file uploads, both symlinks and files copied with pickAndStore, the "client" field shows the service used.

For conversions, the "provider" shows where the file resides. If the file was stored to Filestack's storage, the provider will be "internal", otherwise it could be "amazon" if the original was stored to S3, or one of the cloud drives Filestack connects to, such as "Dropbox" if the link to the file was a symlink.

The following are examples of what the Dropbox specific webhook messages include and look like:

  1. File Upload (symlink):

  2. {

  3. File Upload (with store):

  4. {

  5. File Export (save to):

  6. {
      "action": "fp.export",
      "timestamp": 1444257665,
      "id": 142447,
        "source": "https://www.filestackapi.com/api/file/qHi4LxRh28IeEBdJcFpw",
        "client": "Dropbox",
        "filename": "newFiletest.jpg",
        "created": "https://www.filestackapi.com/api/file/s40jJOQDGVr2T86cgOAe"

  7. File Conversion:

  8. {