We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
backdraft
2 years agoExplorer | Level 3
Dropbox API Problems
Hi, so I am using Node.js and I realized that I need to refresh the access_token since it expires every so often. I got a refresh token and am trying to get an access token and set it as a variable i...
backdraft
2 years agoExplorer | Level 3
Ok, I made some changes and now I am getting a new error:
error: 'invalid_grant',
error_description: 'refresh token is malformed'
{
grant_type: "refresh_token",
refresh_token: this.refresh_token,
},
{
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
auth: {
username: this.client_id,
password: this.client_secret,
},
}
Здравко
2 years agoLegendary | Level 20
It is exactly what it is... I don't know what more to say.
Ok. Check what actually you have provided with this.refresh_token, for instance. Dump it and see is it a refresh token or by mistake you are providing something else. Check also, is it exactly what has been received on initial authentication (first call to token access point) - even one more or less symbol may (and will) result in such an error. If needed, start from beginning and dump everything on every step, so will be able see where the things are becoming wrong.
Good luck.
PS: Check if everything follows and values are looking like as shown here when you perform the actions on your own as described (there the values may be shorter or different). The logic must be the same even when you use redirect URI with or without PKCE or not use redirect URI at all.
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!