You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
ImpulseWebDev
2 years agoExplorer | Level 3
Issue Generating Refresh Token with OAuth Code Flow
Hello, I have been struggling a bit with getting a refresh token or any success response at all from the endpoint 'https://api.dropboxapi.com/oauth2/token' when following the guide here https://devel...
- 2 years ago
Given your redactions and descriptions, it seems like you're sending a parameter with the name being your app key and the value being your app secret, however that is not the correct formatting. When calling /oauth2/token to exchange the authorization code for an access token/refresh token with the code flow like this, you should send a parameter named "client_id" with the value being your app key, and a parameter named "client_secret" with the value being your app secret. You would do that the same way you already have a parameter named "code" with the value being the authorization code string.
(Note that it's also possible to send the app key and secret as "Basic" authorization, which is what the example in the documentation does using the "-u" curl flag, but that would be encoded and formatted differently. I recommend just using the parameters as described above for simplicity.)
ImpulseWebDev
Explorer | Level 3
Hello and thanks for the reply.
My apologies, I am not very familiar with Curl request syntax, however I was attempting to reproduce the example from the dropbox endpoint docs here:
curl https://api.dropbox.com/oauth2/token \ -d code=<AUTHORIZATION_CODE> \ -d grant_type=authorization_code \ -d redirect_uri=<REDIRECT_URI> \ -u <APP_KEY>:<APP_SECRET>
The last portion '<APP_KEY>:<APP_SECRET>' was why I attempted that method. I have since updated to use the two params suggested, however any idea what would trigger this response? I did return to my app console to verify both key and secret are up to date
ImpulseWebDev
2 years agoExplorer | Level 3
Final reply: The params suggested do work in my non-postman fetch request and return the success response outlined in the docs. That gets me through- Thank you again!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 3 years agoIf 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 or Facebook.
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!