We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Gelembjuk
5 years agoHelpful | Level 5
Dropbox oAuth2 auth process fails with 400 Bad Request when call /oauth2/token
I have got the problem with my app.
It worked fine for long time and now somethign happend. I can not understand what is wrong here.
The problem is with oauth2 auth process.
The first step works fine. I call https://www.dropbox.com/oauth2/authorize with my client_id, redirect_url (it is registered in the app).
User approves access and dropbox redirects me back to the redirect_url and there is the code argument (access code).
When i call /oauth2/token to exchance this code for the access token , i have the http 400 error.
2020-11-04 08:19:43 > POST /oauth2/token HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 5.1) Chrome/23.0.1271.95 Safari/537.11 Host: api.dropboxapi.com Accept: application/x-ms-application, image/gif, application/xaml+xml, *\/* Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip, deflate Connection: Keep-Alive Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 Content-Length: 223 grant_type=authorization_code&code=Vwb***EU_yE&client_id=7cor***3&client_secret=******&redirect_uri=https%3A%2F%2Fdev7-roman-web1.*****.com%2Fdropbox_oauthcalback.htm * upload completely sent off: 223 out of 223 bytes < HTTP/1.1 400 Bad Request < Content-Length: 11 < Content-Type: text/plain < Date: Wed, 04 Nov 2020 08:19:10 GMT < Server: envoy < Connection: close < * Closing connection 12 Bad Request
WHat can be wrong with it? any idea?
Ok. Other possible reason of my problem is that there was wrong User-Agent string n the request (second line from bottom)
- UKCloudNew member | Level 2
I also have this exact problem.
It seems to have occurred afer this change:
https://dropbox.tech/developers/now-available--scoped-apps-and-enhanced-permissions
but in that blog it says that existing Apps will continue to work.
DropBox this is a ig problem for those of us who have existing apps. - GelembjukHelpful | Level 5
I seems found the reason .
My endpoint to do the second step was
https://api.dropboxapi.com/oauth2/token
when i replaced it to
https://www.dropboxapi.com/oauth2/token
all wtarted to work fine.
before it worked. maybe that endpoint support for oauth2 was canceled at some point and i didn't notice
- GelembjukHelpful | Level 5
I hve read the docs. https://www.dropbox.com/developers/documentation/http/documentation
It ways the endpoint must be
https://api.dropboxapi.com/oauth2/token
So, now i am confused.
- GelembjukHelpful | Level 5
Ok. Other possible reason of my problem is that there was wrong User-Agent string n the request (second line from bottom)
- Greg-DBDropbox Staff
This step of the OAuth flow should be accessed on https://api.dropboxapi.com/oauth2/token , not www.
This endpoint is working as expected for me, and it sounds like the original poster here found the issue with the request they were sending.
UKCloud If you're still having trouble with this endpoint though, please share the details of the problem so we can help. Thanks!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months 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!