<?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 Api returning 500 error in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5618466#M10211</link>
    <description>&lt;P&gt;Hello, everyone! I'm trying to get my recently played tracks and I'm getting a 500 error. This is my code, let me know if I'm doing something wrong. Thank you very much!&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;fetch("https://accounts.spotify.com/api/token?grant_type=client_credentials&amp;amp;client_id=&amp;lt;client_id&amp;gt;&amp;amp;client_secret=&amp;lt;client_secret&amp;gt;&amp;amp;scope=user-read-recently-played", {
  method: "POST",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded",
  }
})
.then(response =&amp;gt; response.json())
.then((response) =&amp;gt; {
  fetch("https://api.spotify.com/v1/me/player/recently-played", {
    headers: {
      "Authorization": "Bearer " + response.access_token
    }
   
  })
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2023 00:30:42 GMT</pubDate>
    <dc:creator>marinagarat</dc:creator>
    <dc:date>2023-08-04T00:30:42Z</dc:date>
    <item>
      <title>Api returning 500 error</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5618466#M10211</link>
      <description>&lt;P&gt;Hello, everyone! I'm trying to get my recently played tracks and I'm getting a 500 error. This is my code, let me know if I'm doing something wrong. Thank you very much!&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;fetch("https://accounts.spotify.com/api/token?grant_type=client_credentials&amp;amp;client_id=&amp;lt;client_id&amp;gt;&amp;amp;client_secret=&amp;lt;client_secret&amp;gt;&amp;amp;scope=user-read-recently-played", {
  method: "POST",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded",
  }
})
.then(response =&amp;gt; response.json())
.then((response) =&amp;gt; {
  fetch("https://api.spotify.com/v1/me/player/recently-played", {
    headers: {
      "Authorization": "Bearer " + response.access_token
    }
   
  })
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 00:30:42 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5618466#M10211</guid>
      <dc:creator>marinagarat</dc:creator>
      <dc:date>2023-08-04T00:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Api returning 500 error</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5618519#M10212</link>
      <description>&lt;P&gt;"Since the &lt;A href="https://developer.spotify.com/documentation/web-api/tutorials/client-credentials-flow" target="_blank" rel="noopener"&gt;Client Credentials&lt;/A&gt; flow does not include authorization, only endpoints that do not access user information can be accessed."&lt;/P&gt;&lt;P&gt;You should use another flow, mentioned &lt;A href="https://developer.spotify.com/documentation/web-api/concepts/authorization" target="_blank" rel="noopener"&gt;at this page&lt;/A&gt; instead&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 05:12:40 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5618519#M10212</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-08-04T05:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Api returning 500 error</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5618938#M10217</link>
      <description>&lt;P&gt;+1, I would love to use the client credentials to grab data about the current user (who is associated with the client creds) during build time for a static site. This is a use case that doesn't have a good solution right now.&lt;BR /&gt;&lt;BR /&gt;Any chance Spotify devs could allow for this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Aug 2023 01:01:06 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5618938#M10217</guid>
      <dc:creator>anegri</dc:creator>
      <dc:date>2023-08-05T01:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Api returning 500 error</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5619007#M10218</link>
      <description>&lt;P&gt;@anegri "In scenarios where storing the client secret is not safe (e.g. desktop, mobile apps or JavaScript&lt;STRONG&gt; web apps running in the browser&lt;/STRONG&gt;), you can use the &lt;A href="https://developer.spotify.com/documentation/web-api/tutorials/code-pkce-flow" target="_blank" rel="noopener"&gt;authorization code with PKCE&lt;/A&gt;, as it provides protection against attacks where the authorization code may be intercepted."&lt;/P&gt;</description>
      <pubDate>Sat, 05 Aug 2023 07:36:06 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Api-returning-500-error/m-p/5619007#M10218</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-08-05T07:36:06Z</dc:date>
    </item>
  </channel>
</rss>

