Using Python With Dropbox API

Using Python With Dropbox API is very easy and well documented. Dropbox is where the creator of Python Guido van Rossum spent the last few years of his working carrier so its not really that much of a surprise.

The first thing you will need to do is go to 

https://www.dropbox.com/developers/apps

Create a new app on the DBX Platform

Choose whatever API you want.

dropbox api

I chose the regular Dropbox API

Next, choose the type of access you need One Folder or All of Dropbox

Then pick a name for your app and click Create App.

Once you are in the app go down to the Oauth area and click on Generate under Generated Access Token save that cause you will need it for all API requests.

key generation

Now install dropbox module via pip.

pip install dropbox

or Install from source:

git clone git://github.com/dropbox/dropbox-sdk-python.git
cd dropbox-sdk-python
python setup.py install

To make sure its working just list the folders if there is a lot in the directory it can take a minute.

import dropbox
dbx = dropbox.Dropbox(“YOUR_ACCESS_TOKEN”)
dbx.users_get_current_account()
for entry in dbx.files_list_folder(”).entries: print(entry.name)