curl from the Windows command line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Labels:
-
command line
-
curl

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page