Authorization Code Flow Automation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
api oauth
-
API request
-
API Support
-
api token
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page