shaw kwok
shaw kwok

Reputation: 241

Spotify check if access_token is expired

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.

Upvotes: 5

Views: 5913

Answers (1)

Michael Thelin
Michael Thelin

Reputation: 4830

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. 

Upvotes: 9

Related Questions