We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Jerao91
2 years agoExplorer | Level 4
refresh token is malformed
Hello!
I need help because I'm a little confused with the refresh token for integrations via API
I am using this guide: https://www.dropbox.com/developers/documentation/http/documentation...
Greg-DB
Dropbox Community Moderator
2 years agoThe "refresh token is malformed" error would indicate that the value you're passing in to the "refresh_token" parameter does not have the right format. You would need to make sure you're passing in the full/exact value that you received in the "refresh_token" response field from /oauth2/token when you called with 'grant_type=authorization_code'. Make sure you're not accidentally using a different value, or modifying the string, etc.
However, note that you don't need to call /oauth2/token with grant_type: 'refresh_token' yourself like you are trying to with axios. If you have a refresh token, you can and should just pass it directly to the Dropbox SDK using the "refreshToken" parameter on the Dropbox object (instead of the "accessToken" parameter you currently do). The SDK will handle the refresh process for you using that refresh token, as long as it is a valid refresh token.
Check out this blog post for an example to understand how this process works.
- Jerao912 years agoExplorer | Level 4
Good day! How are you? thanks for your response
Yeah, was taking the value from access_token and not refresh_token 😅.
So nothing, it was just that, everything now works correctly!
This can be considered solved.
Thank you!
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!