<?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: api,Get Recently Played Tracks in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212860#M14550</link>
    <description>&lt;P&gt;Hi jasperjarecki, thanks for posting your code.&lt;/P&gt;&lt;P&gt;I don't see how you acquired the Bearer token. I think there is a mistake in the step of getting it.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2024 11:11:12 GMT</pubDate>
    <dc:creator>Ximzend</dc:creator>
    <dc:date>2024-07-24T11:11:12Z</dc:date>
    <item>
      <title>api,Get Recently Played Tracks</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6211385#M14536</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(iPhone 13)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;iOS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using the Authorization Code Flow to obtain a token and trying to make a request to get recently played tracks (Get Recently Played Tracks). However, I am encountering a 403 error.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The first time I made this request, it succeeded and I was able to retrieve the recently played tracks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The response body indicates: "Check settings on developer.spotify.com/dashboard, the user may not be registered."&lt;/P&gt;&lt;P&gt;Could you please assist me in resolving this issue?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 15:57:42 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6211385#M14536</guid>
      <dc:creator>jasperjarecki</dc:creator>
      <dc:date>2024-07-23T15:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: api,Get Recently Played Tracks</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212465#M14540</link>
      <description>&lt;P&gt;Hi jasperjarecki, welcome back to the Community!&lt;/P&gt;&lt;P&gt;Are you trying to use it with your developer account or another?&lt;/P&gt;&lt;P&gt;And could you please add a code block with your code, so I can help you find the bug?&lt;/P&gt;&lt;P&gt;You can insert a code block by first clicking on …, and then on &amp;lt;/&amp;gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 04:56:13 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212465#M14540</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2024-07-24T04:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: api,Get Recently Played Tracks</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212718#M14544</link>
      <description>&lt;LI-CODE lang="markup"&gt;enum SearchMusicAPI {
    case searchMusic(byName: String, limit: Int, type: String, offset: Int)
    case getRecently(limit: Int)
}

extension SearchMusicAPI: TargetType {
    enum Parameters {
      
        static let limit = "limit"
       
    }
        
    var baseURL: URL {
        guard let url = Constants.API.baseURL else { fatalError() }
        return url
    }
    
    var path: String {
        switch self {
        
        case .getRecently: return "/v1/me/player/recently-played"
        }
    }
    
    var method: Moya.Method { .get }
    
    var sampleData: Data { return "".data(using: .utf8)! }
    
    var headers: [String: String]? {
        switch self {
        case .getRecently:
            return ["Authorization" : "Bearer " + (UserDefaults.standard.string(forKey: "token") ?? ""),
                    "Content-Type" : "application/json",
                    "Accept" : "application/json"]
        }
    }
        
    var task: Task {
        switch self {
      
        case let .getRecently(limit):
            return .requestParameters(parameters: [Parameters.limit : limit],
                                      encoding: URLEncoding.default)
        }
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Jul 2024 08:52:12 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212718#M14544</guid>
      <dc:creator>jasperjarecki</dc:creator>
      <dc:date>2024-07-24T08:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: api,Get Recently Played Tracks</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212856#M14549</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am adding code with the token retrieval service, but the code keeps getting deleted.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 11:04:15 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212856#M14549</guid>
      <dc:creator>jasperjarecki</dc:creator>
      <dc:date>2024-07-24T11:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: api,Get Recently Played Tracks</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212860#M14550</link>
      <description>&lt;P&gt;Hi jasperjarecki, thanks for posting your code.&lt;/P&gt;&lt;P&gt;I don't see how you acquired the Bearer token. I think there is a mistake in the step of getting it.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 11:11:12 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212860#M14550</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2024-07-24T11:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: api,Get Recently Played Tracks</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212930#M14555</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Снимок экрана 2024-07-24 в 14.58.49.png" style="width: 400px;"&gt;&lt;img src="https://community.spotify.com/t5/image/serverpage/image-id/176030i52D61EE2D27BC716/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Снимок экрана 2024-07-24 в 14.58.49.png" alt="Снимок экрана 2024-07-24 в 14.58.49.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Снимок экрана 2024-07-24 в 14.58.56.png" style="width: 400px;"&gt;&lt;img src="https://community.spotify.com/t5/image/serverpage/image-id/176028iD00464917BC6BC5F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Снимок экрана 2024-07-24 в 14.58.56.png" alt="Снимок экрана 2024-07-24 в 14.58.56.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Снимок экрана 2024-07-24 в 14.58.39.png" style="width: 400px;"&gt;&lt;img src="https://community.spotify.com/t5/image/serverpage/image-id/176029iD4F782178CD0CE03/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Снимок экрана 2024-07-24 в 14.58.39.png" alt="Снимок экрана 2024-07-24 в 14.58.39.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 12:00:11 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6212930#M14555</guid>
      <dc:creator>jasperjarecki</dc:creator>
      <dc:date>2024-07-24T12:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: api,Get Recently Played Tracks</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6213166#M14556</link>
      <description>&lt;P&gt;That is inconvenient that it keeps getting deleted. Thank you providing screenshots anyway.&lt;BR /&gt;I don't see any obvious bugs. As you noticed the first time running your code, it worked.&lt;BR /&gt;Does the Bearer token get stored anywhere at your machine? And do you test this app with your developer account, or another?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 15:33:54 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/api-Get-Recently-Played-Tracks/m-p/6213166#M14556</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2024-07-24T15:33:54Z</dc:date>
    </item>
  </channel>
</rss>

