Created
June 4, 2013 12:27
-
-
Save anonymous/5705535 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include the Dropbox SDK libraries | |
from dropbox import client, rest, session | |
# Get your app key and secret from the Dropbox developer website | |
APP_KEY = 'KEYKEYKEY' | |
APP_SECRET = 'SECRET' | |
# ACCESS_TYPE should be 'dropbox' or 'app_folder' as configured for your app | |
ACCESS_TYPE = 'dropbox' | |
sess = session.DropboxSession(APP_KEY, APP_SECRET, ACCESS_TYPE) | |
request_token = sess.obtain_request_token() | |
url = sess.build_authorize_url(request_token) | |
# Make the user sign in and authorize this token | |
print "url:", url | |
print "Please visit this website and press the 'Allow' button, then hit 'Enter' here." | |
raw_input() | |
# This will fail if the user didn't visit the above URL | |
access_token = sess.obtain_access_token(request_token) | |
#Print the token for future reference | |
print access_token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment