<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic curl from the Windows command line in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/curl-from-the-Windows-command-line/m-p/5569062#M8959</link>
    <description>&lt;P&gt;on Windows 10...&lt;/P&gt;&lt;P&gt;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).&amp;nbsp; It was cool because I could add any number of tracks to a playlist from a simple script file (bat)&lt;/P&gt;&lt;P&gt;(... albeit, with some included pauses and some escape characters)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -X "POST" "&lt;A href="https://api.spotify.com/v1/playlists/my-playlist-id/tracks" target="_blank" rel="noopener"&gt;https://api.spotify.com/v1/playlists/my-playlist-id/tracks&lt;/A&gt;?&lt;BR /&gt;uris=spotify%3Atrack%3A0P7DoyGrr4Wp9w5TotEtUC"&lt;BR /&gt;-H "Accept: application/json"&lt;BR /&gt;-H "Content-Type: application/json"&lt;BR /&gt;-H "Content-length: 0"&lt;BR /&gt;-H "Authorization: Bearer bearer-id-obtained-by-requesting-token-from-spotify-api-demo-web-page-with-necessary-scopes"&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That once-familiar web interface for obtaining tokens isn't there now but I can successfully obtain one as follows... no problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -X POST "&lt;A href="https://accounts.spotify.com/api/token" target="_blank" rel="noopener"&gt;https://accounts.spotify.com/api/token&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;-H "Content-Type: application/x-www-form-urlencoded"&lt;/P&gt;&lt;P&gt;-d "grant_type=client_credentials&lt;/P&gt;&lt;P&gt;&amp;amp;client_id=my-id&lt;/P&gt;&lt;P&gt;&amp;amp;client_secret=my-secret&lt;/P&gt;&lt;P&gt;&amp;amp;scopes=playlist-modify-private%20playlist-modify-public"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I use that token in the first command above I get:&lt;/P&gt;&lt;P&gt;"This request requires user authentication."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some way to continue using curl from the command line as shown?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Late Edit:&lt;/P&gt;&lt;P&gt;To be a little clearer, here is an image of how easy it was to get an appropriate token in the old interface.&amp;nbsp; Notice it also generated curl commands for you!&amp;nbsp; Very cool.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2023 02:58:48 GMT</pubDate>
    <dc:creator>grsmith26</dc:creator>
    <dc:date>2023-04-25T02:58:48Z</dc:date>
    <item>
      <title>curl from the Windows command line</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/curl-from-the-Windows-command-line/m-p/5569062#M8959</link>
      <description>&lt;P&gt;on Windows 10...&lt;/P&gt;&lt;P&gt;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).&amp;nbsp; It was cool because I could add any number of tracks to a playlist from a simple script file (bat)&lt;/P&gt;&lt;P&gt;(... albeit, with some included pauses and some escape characters)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -X "POST" "&lt;A href="https://api.spotify.com/v1/playlists/my-playlist-id/tracks" target="_blank" rel="noopener"&gt;https://api.spotify.com/v1/playlists/my-playlist-id/tracks&lt;/A&gt;?&lt;BR /&gt;uris=spotify%3Atrack%3A0P7DoyGrr4Wp9w5TotEtUC"&lt;BR /&gt;-H "Accept: application/json"&lt;BR /&gt;-H "Content-Type: application/json"&lt;BR /&gt;-H "Content-length: 0"&lt;BR /&gt;-H "Authorization: Bearer bearer-id-obtained-by-requesting-token-from-spotify-api-demo-web-page-with-necessary-scopes"&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That once-familiar web interface for obtaining tokens isn't there now but I can successfully obtain one as follows... no problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -X POST "&lt;A href="https://accounts.spotify.com/api/token" target="_blank" rel="noopener"&gt;https://accounts.spotify.com/api/token&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;-H "Content-Type: application/x-www-form-urlencoded"&lt;/P&gt;&lt;P&gt;-d "grant_type=client_credentials&lt;/P&gt;&lt;P&gt;&amp;amp;client_id=my-id&lt;/P&gt;&lt;P&gt;&amp;amp;client_secret=my-secret&lt;/P&gt;&lt;P&gt;&amp;amp;scopes=playlist-modify-private%20playlist-modify-public"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I use that token in the first command above I get:&lt;/P&gt;&lt;P&gt;"This request requires user authentication."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some way to continue using curl from the command line as shown?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Late Edit:&lt;/P&gt;&lt;P&gt;To be a little clearer, here is an image of how easy it was to get an appropriate token in the old interface.&amp;nbsp; Notice it also generated curl commands for you!&amp;nbsp; Very cool.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 02:58:48 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/curl-from-the-Windows-command-line/m-p/5569062#M8959</guid>
      <dc:creator>grsmith26</dc:creator>
      <dc:date>2023-04-25T02:58:48Z</dc:date>
    </item>
  </channel>
</rss>

