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.
You can confirm your expiration date anytime by going to Settings > WorkSpace Settings > Social Accounts. Then simply look under the Token Status to learn the expiration date of your accounts token. (This means ContentStudio has access to your social networks for 39 days.
Access tokens issued from the Spotify account service has a lifetime of one hour. If a longer session is desired Spotify account service supports the OAuth Code grant flow.
Tokens are valid for 30 days from creation or last use, so that the 30 day expiration automatically refreshes with each API call. Tokens that aren't used for 30 days expire. The 30-day period is currently fixed and can't be changed for your organization.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With