Our Community is in read-only mode until April 8th, learn more here. You can still search existing threads or get help via Dropbox Support, the Dropbox Help Center, or Learn.
Forum Discussion
lalith-mcw
2 years agoExplorer | Level 3
Re: After token refresh contents still need authorization to download
Thanks that did worked, this is where the whole confusion was. I was thinking the code generated here is `Refresh Token`. But realized this is just `Authorization Code` and checkouted out the solution here as well. Which had clear steps which mentions there are 3 types of tokens `Authorization Code`, `Refresh Token` & `Access Token` (Oauth Token)
Its better the body here is modified to `Authorization Code Generated` instead `Access Code Generated` just confused here.
Used the command here
curl https://api.dropbox.com/oauth2/token \
-d code=AUTHORIZATIONCODEHERE \
-d grant_type=authorization_code \
-u APPKEYHERE:APPSECRETHERE
And from the JSON generated above copied the `Refresh Token` and used it as a python request post() method to fetch the `json().access_token`
curl https://api.dropbox.com/oauth2/token \ -d refresh_token=REFRESHTOKENHERE \ -d grant_type=refresh_token \ -d client_id=APPKEYHERE \ -d client_secret=APPSECRETHERE
And finally it works with dropbox.Dropbox(<access_token>) thanks Здравко DB-Des Greg-DB for the help
Replies have been turned off for this discussion
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!