Need help? Check out Spotify Answers for solutions to a wide range of topics. |
Plan
Student Premium
My Question or Issue
I am currently working on a student project with the Spotify API. On a simple play request (https://api.spotify.com/v1/me/player/play) I am getting this error response:
{
"error": {
"status": 403,
"message": "Player command failed: Premium required",
"reason": "PREMIUM_REQUIRED"
}
}
Is it because I am using a student premium account?
Solved! Go to Solution.
Hi @floriankapaun, welcome to the forum.
The client credentials OAuth flow won't work for this particular endpoint. In order to use the /v1/me/player/play endpoint, try getting an access token through one of the user authentication OAuth flows, like the authorization code flow. You can find out more about the different flows here: https://developer.spotify.com/documentation/general/guides/authorization-guide/
Hey @floriankapaun, thanks for coming to the Spotify Community!
Awesome to hear you’re using Spotify for your project! You should be able to use Spotify Premium
for Students with the API, just like you’d use ‘regular’ Spotify Premium.
Could you make sure you’re using the access-token for the right account? Could you make sure that the account you’re logging into is on Spotify Premium (for Students) on spotify.com/account?
Keep me in loop!
Have a good one,
Hubo
Hi, I have the same problem, I have only one spotify premium account with its
respective app on https://developer.spotify.com/dashboard/applications,
I can play any track at https://developer.spotify.com/console/
but using the api (spotify-web- api-node) I get Player command failed:
Premium required PREMIUM_REQUIRED
Hey @Hubo, thanks for your replay.
I appreciate your help and checked the things you asked for. I am using the right account and access-token. If I'm sending an request to https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj for example with my access-token, everything works as expected.
Best regards,
Florian
Hey @floriankapaun, thanks for keeping me in loop!
Hmm, let's try something else. Could you make sure you're requesting the: 'user-modify-playback-state'-scope element? Also, does this happen with all tracks or just this one?? Let me know how you get on!
Have a good one,
Hubo
Hey @Hubo, thanks for your suggestion.
Unfortunately that doesn't work either.
Let me show you step by step what I did, so we can make sure I didn't make any careless mistakes.
1. Request access-token
POST https://accounts.spotify.com/api/token
"grant_type": "client_credentials"
"client_id": "<my-client-id>"
"client_secret": "<my-client-secret>"
"scope": "user-modify-playback-state"
This returns
{
"access_token": "<my-access-token>",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "user-modify-playback-state"
}
2. Start/Resume a User's Playback
PUT https://api.spotify.com/v1/me/player/play
Authentication: Bearer "<my-access-token>"
And that returns
{
"error": {
"status": 403,
"message": "Player command failed: Premium required",
"reason": "PREMIUM_REQUIRED"
}
}
Hi @floriankapaun, welcome to the forum.
The client credentials OAuth flow won't work for this particular endpoint. In order to use the /v1/me/player/play endpoint, try getting an access token through one of the user authentication OAuth flows, like the authorization code flow. You can find out more about the different flows here: https://developer.spotify.com/documentation/general/guides/authorization-guide/