cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more 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: 

What is the best way to check access token is expired

What is the best way to check access token is expired

SuryaMopuru
Explorer | Level 3

I need to know the most appropriate way to check my access token is expired or not? Can anyone suggest with an example

1 Reply 1

Greg-DB
Dropbox Staff

When you retrieve a short-lived access token via /oauth2/token, the response includes the expiration information in the 'expires_in' field. You can store and refer to that information to check if the short-lived access token would be expired at any point in time.

 

To actively check if any particular access token is still valid though, you would need to perform an API call. For example, for user-linked access tokens, calling /2/check/user or /2/users/get_current_account would be good options, as those don't have any side effects. (Likewise, for team-linked access tokens, you could use /2/team/get_info.)

Need more support?
Who's talking

Top contributors to this post

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