Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Kentwt
3 years agoNew member | Level 2
How to get an access token and refresh token
I am encountering issues when trying to obtain an access token and refresh token. I retrieved the access code from the following URL: https://www.dropbox.com/oauth2/authorize?client_id=<app key>&r...
- 3 years ago
When you say you executed it, it sounds like you're referring to the step where you call /oauth2/token to exchange the authorization code for a refresh token and access token. It looks you're sending the parameters as JSON though, but the /oauth2/token endpoint requires application/x-www-form-urlencoded POST parameters, not JSON. Please update your code to send those parameters as application/x-www-form-urlencoded POST parameters. There's an example of this flow here that may be helpful.
Greg-DB
Dropbox Community Moderator
3 years agoWhen you say you executed it, it sounds like you're referring to the step where you call /oauth2/token to exchange the authorization code for a refresh token and access token. It looks you're sending the parameters as JSON though, but the /oauth2/token endpoint requires application/x-www-form-urlencoded POST parameters, not JSON. Please update your code to send those parameters as application/x-www-form-urlencoded POST parameters. There's an example of this flow here that may be helpful.
- Kentwt3 years agoNew member | Level 2
Thank you for your help. It is working properly 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!