Stats

1626 Contributors: 3
2016-09-12
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Getting started with Dropbox API

Download dropbox-api eBook

Remarks

The Dropbox API allows developers to build Dropbox functionality directly into their apps.

The API allows access to features such as file uploading, downloading, sharing, searching, and restoration. The API can be used across platforms such as Windows, Mac, Linux, iOS, Android, or any other that can make HTTPS connections.

More information, including the full documentation for the Dropbox API, usage guidelines, and developer tools such as official SDKs can be found on the Dropbox API website.

The first step is to register an API app with Dropbox.

Versions

VersionRelease Date
22015-11-04

Getting an OAuth 2 access token for the Dropbox API via the code grant using curl

Abbreviated from https://blogs.dropbox.com/developers/2013/07/using-oauth-2-0-with-the-core-api/:

Step 1: Begin authorization

Send the user to this web page, with your values filled in:

https://www.dropbox.com/oauth2/authorize?client_id=<app key>&response_type=code&redirect_uri=<redirect URI>&state=<CSRF token>

The authorization code will be included as the code parameter on the redirect URI.

Step 2: Obtain an access token

curl https://api.dropbox.com/oauth2/token -d code=<authorization code> -d grant_type=authorization_code -d redirect_uri=<redirect URI> -u <app key>:<app secret>

Step 3: Call the API

In your API call, set the header:

Authorization: Bearer <access token>

Check out the blog post for more details, including an important security note on using state to protect against CSRF attacks.