Hi,
I'm new to this and need some help with setting up access with my Dropbox app to a Dropbox account using Python. When running the code I get the error shown below. I have inserted the app and secret codes into it. Plus the app has an API token. Any guidance would be greatly appreciated.
See python code below error message.
Traceback (most recent call last):
File "dropbox_test.py", line 2, in <module>
import dropbox
File "/Users/ninekay/Desktop/Python/dropbox.py", line 24
client = dropbox.client.DropboxClient(access_token)
import dropbox
app_key = 'qdrn1l679o14y86'
app_secret = '<redacted>'
flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)
authorize_url = flow.start()
print '1. Go to: ' + authorize_url
print '2. Click "Allow" (you might have to log in first)'
print '3. Copy the authorization code.'
code = raw_input("Enter the authorization code here: ").strip()
access_token, user_id = flow.finish(code)
client = dropbox.client.DropboxClient(access_token)
print 'linked account: ', client.account_info()
f = open('working-draft.txt', 'rb')
response = client.put_file('/magnum-opus.txt', f)
print 'uploaded: ', response
folder_metadata = client.metadata('/')
print 'metadata: ', folder_metadata
f, metadata = client.get_file_and_metadata('/magnum-opus.txt')
out = open('magnum-opus.txt', 'wb')
out.write(f.read())
out.close()
print metadata