We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
jfreer
3 years agoExplorer | Level 4
400 BadRequest from .Net client when using refresh tokens
We are using the .Net SDK client vs 6.14. We primarily use the Files.GetMetadataSync and Files.SaveUrlAsync api calls. We call the API with a variety of long-lived accessTokens and refreshTokens depe...
- 3 years ago
There are a number of scenarios that can cause the refresh to fail like this, such as:
- missing/incorrect/malformed refresh token
- revoked refresh token (e.g., when the user unlinks the app via https://www.dropbox.com/account/connected_apps , etc.)
- missing/incorrect/malformed app key
- incorrect/malformed app secret
- missing app secret (if the refresh token was retrieved using the non-PKCE flow)
The response body on that 400 error response would contain a more specific error message, though the .NET SDK unfortunately does not currently expose that. There's an open request to update it to do so.
So, make sure you're supplying the correct values. Since it sounds like this is only happening for a few users though, but for all calls for those users, it may be that the refresh tokens for those users are revoked, in which case you should have the users relink the app to get a new one.
Greg-DB
3 years agoDropbox Staff
There are a number of scenarios that can cause the refresh to fail like this, such as:
- missing/incorrect/malformed refresh token
- revoked refresh token (e.g., when the user unlinks the app via https://www.dropbox.com/account/connected_apps , etc.)
- missing/incorrect/malformed app key
- incorrect/malformed app secret
- missing app secret (if the refresh token was retrieved using the non-PKCE flow)
The response body on that 400 error response would contain a more specific error message, though the .NET SDK unfortunately does not currently expose that. There's an open request to update it to do so.
So, make sure you're supplying the correct values. Since it sounds like this is only happening for a few users though, but for all calls for those users, it may be that the refresh tokens for those users are revoked, in which case you should have the users relink the app to get a new one.
- Intellicode Mangement Systems3 years agoExplorer | Level 3
Any examples on how the DropboxClient needs to be constructed for refresh tokens?
- Greg-DB3 years agoDropbox Staff
Intellicode Mangement Systems Yes, for the official Dropbox API v2 .NET SDK, you can find an example of getting and using a refresh token in the OauthBasic example (non-PKCE, meant for server-side apps) as well as in the OAuthPKCE example (PKCE, meant for client-side apps)
- Intellicode Mangement Systems3 years agoExplorer | Level 3
Response status code does not indicate success: 400 (Bad Request).
Still the reponse I am geting no luck!!!
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!