We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Mark R.5
9 years agoHelpful | Level 5
API V2 .NET Checking for a valid access token
What is the recommended way to check whether a saved access token is valid or not (e.g. a user may have revoked access via the website)? I guess I am looking for the equivalent of the old HasLink...
- 9 years ago
Access tokens can be revoked remotely at any time, so the only way to check if it's still valid is to make an API call. The GetCurrentAccountAsync method is a good one for that, as it doesn't have any side effects.
(By the way, I believe the old HasLinkedAccount method you referred to didn't actually do that, and only checked for the local existence of an access token.)
Greg-DB
Dropbox Community Moderator
9 years agoAccess tokens can be revoked remotely at any time, so the only way to check if it's still valid is to make an API call. The GetCurrentAccountAsync method is a good one for that, as it doesn't have any side effects.
(By the way, I believe the old HasLinkedAccount method you referred to didn't actually do that, and only checked for the local existence of an access token.)
Mark R.5
9 years agoHelpful | Level 5
Ok thanks. So if that method throws an exception I guess I know all is not well. Interesting about HasLinkedAccount, that could explain some occasional unusual behavior in my app.
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!