Forum Discussion

axew3's avatar
axew3
Collaborator | Level 8
10 years ago
Solved

Best way to know if a token is still valid?

Hi all, i look into API docs endpoints, and i can't find out the correct way to establish if a token is still valid or not. Or better i could but a suggestion maybe is best ...

I mean this: on an user interface, the generated token is shown to user when he load his profile. Than i would like know before than the page load, if the token is active or not. Since no curl call is done on profile, except when the user click to request/generate a new token, when user load page, i could arbitrary do a curl call to check if error come out, and establish if the token is still valid, or has been maybe revoked by user via/into dropbox.com account.

What the best way?

I've not read something about somewhere (as this is very probably due to my Eng) maybe.

Thank you!

  • The best way to check if an access token is still valid with the Dropbox API is just to make a call and check the response. For example, a simple call with no side effects such as /2/users/get_current_account is a good one for this.

2 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    The best way to check if an access token is still valid with the Dropbox API is just to make a call and check the response. For example, a simple call with no side effects such as /2/users/get_current_account is a good one for this.

  • axew3's avatar
    axew3
    Collaborator | Level 8
    10 years ago

    :christmas_tree:  :relieved:  Thank you!

About Dropbox API Support & Feedback

Node avatar for 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!