cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to verify token correctness after instantiating DbxClient?

How to verify token correctness after instantiating DbxClient?

mlkmn
Explorer | Level 4
Go to solution

I'm verifying several things during my component initializitation, one of which is the "state" of the newly initialized DbxClient. Is there any way to determine whether the token passed as a argument is correct or the general host is responding? I would expect methods like "assertTokenCorrectness" or "checkConnectionStatus" in either DbxClientV2 class or any other utilty/helper class. So far the only way to determine things I mentioned is to actually fire method like DbxClientV2.files().listFolder() and check if it throws DbxException.

 

To be honest, I really doubt there is any suitable method I missed but at least my need would evolve into a feature request :slightly_smiling_face: .

 

I would appreciate any tips for better workaround than mine.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Tokens can be remotely revoked at any time, so the best way to check if a token is still valid is to just try an API call. The getCurrentAccount call is a good choice for this, as it doesn't have any side effects.

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

Tokens can be remotely revoked at any time, so the best way to check if a token is still valid is to just try an API call. The getCurrentAccount call is a good choice for this, as it doesn't have any side effects.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?