Announcements

Help Wizard

Step 1

NEXT STEP

Authorization Code Flow Automation

Authorization Code Flow Automation

Plan

Premium

Country

UK

Device

Lenovo Laptop

Operating System

Windows

 

My Question or Issue

I am working on a program that can play/pause/skip songs etc.

I first tried using the Client Credentials Flow, but got this error:

 

 

 

{
  "error": {
    "status": 403,
    "message": "Player command failed: Premium required",
    "reason": "PREMIUM_REQUIRED"
  }
}

 

 

 

Using this forum, I found out that you cannot interact with the v1/me/player endpoint using the access token from Client Credentials and you have to use the access token gained from the Authorization Code Flow.

 

I used the template given from the Web API Tutorial and it was functioning and would give me a valid access token that can interact with the v1/me/player endpoint.

 

However, it is a very manual process to get the token(have to create a HTML page and log in to authorize), whereas with the Client Credentials, you could get the token just through some code and no manual input.

 

I was wondering if there was a way to automate the Authorization Code Flow to get the access token so that I can then play/pause music etc. all through my program without any manual authorization?

 

Thanks,

Ryan

Reply
1 Reply

I have exactly the same problem. I am using the Authorization Code Flow for an interactive CLI. However I am not able to test my code with an CI workflow, because there is no automatic way for me to authenticate. Hopefully there will be a solution to this problem soon.

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random