4

A small questions. At the moment i'm using Spotify Webapi, and I want to know is there a Web API Endpoint to check if an access_token is expired? At the moment I'm using

GET https://api.spotify.com/v1/me

to check if an access_token is expired.

shaw kwok
  • 231
  • 5
  • 11

1 Answers1

8

There's no endpoint to check how long time there's left until a token expires, but you can use the response to the access token request to find out.

As explained in the Web API Authorization Guide, the response including the access token also contains

expires_in   int    The time period (in seconds) for which the access token is valid. 
Michael Thelin
  • 4,332
  • 2
  • 21
  • 29