Accessing Dropbox files via RESTful API

In this article, I will guide you through the steps to access Dropbox files from an app. If you want to skip the document and see some sample code; check my following pet projects accessing Dropbox:

App Registration

Assuming that you have a working Dropbox account, you should go to and create a new app. The steps are very straightforward and intuitive.

Here are the recommended settings for a simple access model:

  • Status: Development
  • Development users: Only you
  • Permission type: App folder
  • App folder name: my_app_folder (or whatever you want)
  • OAuth2
    • Redirect URI’s: (empty)
    • Allow implicit grant: Allow
  • Chooser / saver / embedder domains: (empty)
  • Webhooks: (empty)

Note your app key & app secret. You will need those later.


Authorization (get code)

Forward your user to the URL:

When the user authenticates here, he/she will copy a code to the clipboard and come back to your app. This code symbolizes that he/she is allowing your app to access his/her Dropbox folder.

Ask the user for that code via your GUI.

Authentication (get token)

In the background, go to the URL via HTTP POST. The header should contain:

  • Authorization: Basic APP_KEY:APP_SECRET

Dropbox will hopefully return a token to you. From now on, you will include this token to your future requests whenever you want to access the users Dropbox folder.

At this point, my_app_folder (or whatever name you gave) will be created in the Dropbox folder of the client.

Download file

Go to over HTTP POST. The header should contain:

  • Authorization: Bearer USERTOKEN
  • Dropbox-API-Arg: {“path”: “/YOUR_FILE_TO_DOWNLOAD.TXT”}

Dropbox will hopefully return the requested file to you. Please note that the file must be placed in the app folder that DropBox created for you (my_app_folder or whatever).


This document demonstrated the most basic way to add Dropbox functionality to your app. Please note that Dropbox provides many further options; such as:

  • Accessing the entire Dropbox structure of the user
  • Redirecting (in case you are writing a Web app)
  • Web hooks
  • etc…

I’m leaving the further discovery to you.





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s