We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
JustADev
4 years agoNew member | Level 2
oauth2/token endpoint not returning refresh_token
My app starts the oauth flow with a URL like this:
https://www.dropbox.com/oauth2/authorize?response_type=code&client_id=<APP_CODE>&token_access_type=offline
After the user authorizes the...
Greg-DB
Dropbox Community Moderator
4 years ago[Cross-linking for reference: https://stackoverflow.com/questions/73155941/dropbox-oauth2-token-endpoint-not-returning-refresh-token ]
I just checked and this is working for me:
# https://www.dropbox.com/oauth2/authorize?response_type=code&client_id=u1v<redacted>&token_access_type=offline
# resulted in:
# Access Code Generated
# Enter this code into <redacted> to finish the process
# Zu9U1<redacted>
curl -X POST https://www.dropbox.com/oauth2/token \
-d code=Zu9U1<redacted> \
-d grant_type=authorization_code \
-d client_id=u1v<redacted> \
-d client_secret=<redacted>
{"access_token": "sl.BMQ<redacted>", "token_type": "bearer", "expires_in": 14400, "refresh_token": "_Ql10<redacted>", "scope": "account_info.read file_requests.read files.content.read files.content.write files.metadata.read files.metadata.write sharing.read sharing.write", "uid": "225<redacted>", "account_id": "dbid:AAB<redacted>"}
The JSON result from /oauth2/token contains a "refresh_token" field with the refresh token string. How are you checking the returned payload for the refresh token?
If this isn't working for you, please show the actual /oauth2/authorize authorization and /oauth2/token request and response (just redacting private values).
JustADev
4 years agoNew member | Level 2
My bad. I was using saved URL to create the web URL. And that saved URL did not have the correct token_access_type field. Thank you for help. This is working now.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!