- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Plan
Free
Country
Ukraine
Device
MacBookPro Retina, on Chrome
Operating System
(iOS )
My Question or Issue:
Hi, guys! I'm a developer building a non-commercial ReactJs app to showcase my skills of working with APIs and AJAX requests.
Here's the problem I encountered:
One of my functions make a call to
GET https://api.spotify.com/v1/users/{user_id}/playlists
in order to get the list of playlists, a user has in Spotify.
While the second call to the same endpoint returns the correct list of playlists, the first call always returns the same JSON consisting of 2 playlists, which aren't actually in the user's library (I checked this bug with 2 accounts currently and had the same outcome every time). Here is the JSON I get :
- (2) [{…}, {…}]
- 0:
- collaborative: false
- description: ""
- external_urls: {spotify: ""}
- href: "https://api.spotify.com/v1/playlists/1Wjl5nNjiOZJDAuHBvSDIe"
- id: "1Wjl5nNjiOZJDAuHBvSDIe"
- images: (3) [{…}, {…}, {…}]
- name: "nirvana prefes"
- owner: {display_name: "undefined", external_urls: {…}, href: "https://api.spotify.com/v1/users/undefined", id: "undefined", type: "user", …}
- primary_color: null
- public: true
- snapshot_id: "MTMsZjUxMmZjMDg4ODIyYTAyNjZmZjJhNTNmY2JhMmUyOGNhYzc1M2JkNQ=="
- tracks: {href: "https://api.spotify.com/v1/playlists/1Wjl5nNjiOZJDAuHBvSDIe/tracks", total: 10}
- type: "playlist"
- uri: "spotify:playlist:1Wjl5nNjiOZJDAuHBvSDIe"
- __proto__: Object
- 1:
- collaborative: false
- description: ""
- external_urls: {spotify: ""}
- href: "https://api.spotify.com/v1/playlists/3zi6HOncBZUIlB0bikQ9YD"
- id: "3zi6HOncBZUIlB0bikQ9YD"
- images: (3) [{…}, {…}, {…}]
- name: "Keep Calm"
- owner: {display_name: "undefined", external_urls: {…}, href: "https://api.spotify.com/v1/users/undefined", id: "undefined", type: "user", …}
- primary_color: null
- public: true
- snapshot_id: "NjMsODQ2NDljZThkZDIwNzM2OTJmMjA0M2EwMDNjOTAzNzQ2MTQxNmYwMw=="
- tracks: {href: "https://api.spotify.com/v1/playlists/3zi6HOncBZUIlB0bikQ9YD/tracks", total: 57}
- type: "playlist"
- uri: "spotify:playlist:3zi6HOncBZUIlB0bikQ9YD"
- __proto__: Object
- length: 2
- __proto__: Array(0)
So, I've got nothing agains nirvana or keeping Calm, but I can't keep calm while my app is not working correctly 😃
Please help me out. Thanks in advance!
PS the function is:
Solved! Go to Solution.
- Labels:
-
Developer
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page