Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am trying to use the `DropboxOAuth2FlowNoRedirect` example in the Python class docstring. It looks like this:
from dropbox import DropboxOAuth2FlowNoRedirect
auth_flow = DropboxOAuth2FlowNoRedirect(APP_KEY, APP_SECRET)
authorize_url = auth_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.")
auth_code = raw_input("Enter the authorization code here: ").strip()
try:
oauth_result = auth_flow.finish(auth_code)
except Exception as e:
print('Error: %s' % (e,))
return
dbx = Dropbox(oauth_result.access_token)
The resulting `authorize_url` seems to be malformed: it includes "&" instead of just "&", meaning when navigating to it, Dropbox returns an error: unknown field "amp". Is this a bug or am I doing something wrong?
Thanks
Thanks for the report. This issue doesn't seem to reproduce for me though. To help us investigate, can you share:
Ah. It is something to do with Jupyter Lab. The URL is fine in the iPython REPL and in Jupyter notebook. I am using the Python dropbox package version 10.1.1 and Python 3.8.2.
If I run this code:
from dropbox import DropboxOAuth2FlowNoRedirect, Dropbox auth_flow = DropboxOAuth2FlowNoRedirect(APP_KEY, APP_SECRET) authorize_url = auth_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.") auth_code = input("Enter the authorization code here: ").strip() try: oauth_result = auth_flow.finish(auth_code) except Exception as e: print('Error: %s' % (e,)) dbx = Dropbox(oauth_result.access_token)
in a cell within Jupyter Lab, I get the following output (with client ID removed):
1. Go to: https://www.dropbox.com/oauth2/authorize?response_type=code&client_id=REMOVED 2. Click "Allow" (you might have to log in first). 3. Copy the authorization code.
Enter the authorization code here:
Anyway, this isn't a problem for me, now that I know the URL is properly formed outside of Jupyter Lab.
Thanks!
I see, thanks for the information!
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!