Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

curl from the Windows command line

curl from the Windows command line

on Windows 10...

Just last month (and for years prior) I was able to add items to my playlists using successive curl commands from the command line as follows (sans carriage returns).  It was cool because I could add any number of tracks to a playlist from a simple script file (bat)

(... albeit, with some included pauses and some escape characters)

 

curl -X "POST" "https://api.spotify.com/v1/playlists/my-playlist-id/tracks?
uris=spotify%3Atrack%3A0P7DoyGrr4Wp9w5TotEtUC"
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "Content-length: 0"
-H "Authorization: Bearer bearer-id-obtained-by-requesting-token-from-spotify-api-demo-web-page-with-necessary-scopes"

 

That once-familiar web interface for obtaining tokens isn't there now but I can successfully obtain one as follows... no problem:

 

curl -X POST "https://accounts.spotify.com/api/token"

-H "Content-Type: application/x-www-form-urlencoded"

-d "grant_type=client_credentials

&client_id=my-id

&client_secret=my-secret

&scopes=playlist-modify-private%20playlist-modify-public"

 

However, when I use that token in the first command above I get:

"This request requires user authentication."

 

Is there some way to continue using curl from the command line as shown?

 

Late Edit:

To be a little clearer, here is an image of how easy it was to get an appropriate token in the old interface.  Notice it also generated curl commands for you!  Very cool.

 

GetToken.png
Reply
0 Replies

Suggested posts

Type a product name