<?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 Re: Get a permanent token for API calls in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412703#M5175</link>
    <description>&lt;P&gt;Hi Remy,&amp;nbsp;&lt;/P&gt;&lt;P&gt;when requesting the Access Token you will also get a Refresh Token . With the Refresh Token you can generate a new Access Token if it has expired, this does not need user intervention&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 00:17:24 GMT</pubDate>
    <dc:creator>ffkangoroo</dc:creator>
    <dc:date>2022-08-03T00:17:24Z</dc:date>
    <item>
      <title>Get a permanent token for API calls</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412654#M5173</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a Python script to update playlists (throught API calls). It works fine, but I have to generate a new token each hour from the Spotify Web API Console. Is there a way to get a permanent token in order to be able to use it in a scheduled script ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rémy&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 20:59:16 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412654#M5173</guid>
      <dc:creator>Rémy-J</dc:creator>
      <dc:date>2022-08-02T20:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get a permanent token for API calls</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412703#M5175</link>
      <description>&lt;P&gt;Hi Remy,&amp;nbsp;&lt;/P&gt;&lt;P&gt;when requesting the Access Token you will also get a Refresh Token . With the Refresh Token you can generate a new Access Token if it has expired, this does not need user intervention&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 00:17:24 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412703#M5175</guid>
      <dc:creator>ffkangoroo</dc:creator>
      <dc:date>2022-08-03T00:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get a permanent token for API calls</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412814#M5178</link>
      <description>&lt;P&gt;Hi&amp;nbsp;ffkangoroo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen this notion of "refresh token" in the documentation. But&amp;nbsp;I don't know which API call to do to refresh a token received by the "&lt;SPAN&gt;Spotify Web API Console".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you give me an example of an API call ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rémy&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 07:25:23 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412814#M5178</guid>
      <dc:creator>Rémy-J</dc:creator>
      <dc:date>2022-08-03T07:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get a permanent token for API calls</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412841#M5179</link>
      <description>&lt;P&gt;Sure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is described here:&amp;nbsp;&lt;A href="https://developer.spotify.com/documentation/general/guides/authorization/code-flow/" target="_self"&gt;Code Flow Guide&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There you will find the following Example (with the refresh_token beeing provided through the route in your app you could have stored it in the Database.):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The following example retrieves a refreshed Access Token once the current one has expired:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;app&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;get&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;/refresh_token&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;function&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;req&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;res&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;

  &lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;refresh_token&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;req&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;query&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;refresh_token&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;authOptions&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;url&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;https://accounts.spotify.com/api/token&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;headers&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt; &lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;Authorization&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;Basic &lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt; &lt;SPAN class=""&gt;+&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;Buffer&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;client_id&lt;/SPAN&gt; &lt;SPAN class=""&gt;+&lt;/SPAN&gt; &lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt; &lt;SPAN class=""&gt;+&lt;/SPAN&gt; &lt;SPAN class=""&gt;client_secret&lt;/SPAN&gt;&lt;SPAN class=""&gt;).&lt;/SPAN&gt;&lt;SPAN class=""&gt;toString&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;base64&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;))&lt;/SPAN&gt; &lt;SPAN class=""&gt;},&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;form&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;
      &lt;SPAN class=""&gt;grant_type&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;refresh_token&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
      &lt;SPAN class=""&gt;refresh_token&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;refresh_token&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;},&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;json&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;true&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;};&lt;/SPAN&gt;

  &lt;SPAN class=""&gt;request&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;post&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;authOptions&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;function&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;error&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;response&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;body&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;if&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;!&lt;/SPAN&gt;&lt;SPAN class=""&gt;error&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class=""&gt;response&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;statusCode&lt;/SPAN&gt; &lt;SPAN class=""&gt;===&lt;/SPAN&gt; &lt;SPAN class=""&gt;200&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;
      &lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;access_token&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;body&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;access_token&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;
      &lt;SPAN class=""&gt;res&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;send&lt;/SPAN&gt;&lt;SPAN class=""&gt;({&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;access_token&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;access_token&lt;/SPAN&gt;
      &lt;SPAN class=""&gt;});&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;}&lt;/SPAN&gt;
  &lt;SPAN class=""&gt;});&lt;/SPAN&gt;
&lt;SPAN class=""&gt;});&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;The response will be similar to this:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;
   &lt;SPAN class=""&gt;"access_token"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;"NgA6ZcYI...ixn8bUQ"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
   &lt;SPAN class=""&gt;"token_type"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;"Bearer"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
   &lt;SPAN class=""&gt;"scope"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;"user-read-private user-read-email"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
   &lt;SPAN class=""&gt;"expires_in"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;3600&lt;/SPAN&gt;
&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Aug 2022 08:26:10 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5412841#M5179</guid>
      <dc:creator>ffkangoroo</dc:creator>
      <dc:date>2022-08-03T08:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get a permanent token for API calls</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5460731#M7106</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple Node.js application to get a refresh token throught the authorization code flow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/rmjstn/spotify-refresh-token" target="_blank"&gt;https://github.com/rmjstn/spotify-refresh-token&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rémy&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 15:16:37 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Get-a-permanent-token-for-API-calls/m-p/5460731#M7106</guid>
      <dc:creator>Rémy-J</dc:creator>
      <dc:date>2022-11-21T15:16:37Z</dc:date>
    </item>
  </channel>
</rss>

