API Connector Documentation
Import Dropbox Data to Google Sheets
In this guide, we’ll walk through how to import Dropbox data directly into Google Sheets, using the API Connector add-on for Sheets.
Contents
- Before You Begin
- Part 1: Get Your Dropbox API Credentials
- Part 2: Get Dropbox Data in Sheets
- Part 3: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get your Dropbox API Credentials
- Log in to the Dropbox developer console at https://www.dropbox.com/developers
- Navigate to the App Console and click Create app (or click https://www.dropbox.com/developers/apps/create to go there directly)
- Choose the type of access you need (App folder or Full Dropbox), name your app, and click Create app
- Click over to the Permissions tab, tick the boxes for all data you'd like to access, and click Submit. Note: this step must be done before you generate your token, as the token's scopes can't be updated later (if you need to change or add scopes, you'll need to delete your app and create a new one).
- Now click back to the Settings tab of your app. Scroll down the page and click Generate to get your token. Copy this token down and keep it safe, we'll need it shortly.
Part 2: Get Dropbox Data in Sheets
You can see the full list of available endpoint and parameters in the API documentation. For example, to get a list of the files in the root folder of your Dropbox account, run a request like this:
- Open up Google Sheets and click Extensions > API Connector > Open > Create request.
- In the request form enter the following:
- Application:
Custom
- Method:
POST
- Request URL:
https://api.dropboxapi.com/2/files/list_folder
- Headers:
Authorization
:Bearer
your_token
Content-Type
:application/json
- Request body:
{"include_deleted":false,"include_has_explicit_shared_members":false,"include_media_info":false,"include_mounted_folders":true,"include_non_downloadable_files":true,"path":"","recursive":false}
- Application:
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see a list of files populate your sheet.
Note:
The above request contains "path":""
, indicating that it's fetching files from the root directory. To get files from a particular folder, replace the empty quotes with the folder's path, e.g. {"include_deleted":false,"include_has_explicit_shared_members":false,"include_media_info":false,"include_mounted_folders":true,"include_non_downloadable_files":true,"path":"/my test folder","recursive":false}.
Part 3: API Documentation
Official API documentation: https://www.dropbox.com/developers/documentation/http/documentation
Hi Ana,
Thanks so much.
Can you please provide an example of what the path should look like? I've pasted exactly the path in the URL, and it doesn't work: {"include_deleted":false,"include_has_explicit_shared_members":false,"include_media_info":false,"include_mounted_folders":true,"include_non_downloadable_files":true,"path":"/Cool%20People%20-%20(Use%20This%20Folder)/Agency/Untried%20-%20please%20test!/AU%20Content%20Creators","recursive":false}
From testing a bunch of variations, I know that the path is the issue!
I made a test folder in my dropbox called My Test Folder, and added a file into that folder. I then fetched the contents of that folder with this request body:
{"include_deleted":false,"include_has_explicit_shared_members":false,"include_media_info":false,"include_mounted_folders":true,"include_non_downloadable_files":true,"path":"/my test folder","recursive":false}
Does that help? Feel free to share more info about your Dropbox setup through the support page if you'd like me to take a look.