API 403: Studen Premium: Premium required

Solved!
Reply

API 403: Studen Premium: Premium required

floriankapaun
Regular

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution!

Re: API 403: Studen Premium: Premium required

spotifyjosh
Spotify
Spotify

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/

View solution in original post

7 Replies

Re: API 403: Studen Premium: Premium required

Hubo
Rock Star 16
Rock Star 16

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

HuboRock Star 16
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Re: API 403: Studen Premium: Premium required

dayannex
Visitor

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

Re: API 403: Studen Premium: Premium required

floriankapaun
Regular

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

Re: API 403: Studen Premium: Premium required

Hubo
Rock Star 16
Rock Star 16

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

HuboRock Star 16
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Re: API 403: Studen Premium: Premium required

floriankapaun
Regular

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"
  }
}

 

Solution!

Re: API 403: Studen Premium: Premium required

spotifyjosh
Spotify
Spotify

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/

View solution in original post

Re: API 403: Studen Premium: Premium required

floriankapaun
Regular
Thanks @spotifyjosh!
That was the answer to my problem. With an OAuth flow like you suggested everything is working as expected. 🙂
SUGGESTED POSTS