Announcements

Help Wizard

Step 1

NEXT STEP

Public flag broken in user/playlists endpoint

Solved!

Public flag broken in user/playlists endpoint

I've got a web app that queries playlist data from the user endpoint, e.g. `"https://api.spotify.com/v1/users/" + user.id + "/playlists?limit=50&offset=" + offset`. In the response I get a ton of useful playlist data like playlist names, IDs, images, etc. Among this info is the `.public` flag, which connotes whether the playlist is public. I'm finding it's ALWAYS SET TO TRUE at this endpoint. If I form a query for the same playlists to the playlists endpoint, e.g. `"https://api.spotify.com/v1/playlists/" + playlist.id`, then I get accurate information in the `.public` field.

Reply

Accepted Solutions
Marked as solution

Thanks for reaching out pvlkmrv. We had a look and were able to reproduce it. We found the bug and deployed a fix. Are you also seeing proper public flag in the response now?

View solution in original post

3 Replies

Steps to reproduce:

1. Get an access token with enough scope to read private playlists

2. Form the Web API query URL for the user's playlists as above and query the endpoint with `let response = await fetch(url, { headers: { 'Authorization': 'Bearer ' + access_token} })`

3. `let data = response.json()` and navigate through the object to see `public` is always set to `true`

4. Choose a known public playlist and a known private playlist and note their `id`s.

5. Query the playlists endpoint with `let response2 = await fetch(url, { headers: { 'Authorization': 'Bearer ' + access_token} })` and `let data = response2.json()`

6. See the `public` flag is set correctly at this other endpoint, which presumably is how the app and other clients are displaying it correctly despite this bug.

 

My web app is exportify.net. There are links to the GitHub where you can see the code to get an access token and set up some of these calls in `exportify.js`.

Marked as solution

Thanks for reaching out pvlkmrv. We had a look and were able to reproduce it. We found the bug and deployed a fix. Are you also seeing proper public flag in the response now?

It's definitely fixed now. ๐ŸŽ‰ Thanks for a prompt response!

Suggested posts

Let's introduce ourselves!

Hey there you, ย  Yeah, you!ย 😁 ย  Welcome - we're glad you joined the Spotify Community! ย  While you here, let's have a fun game and getโ€ฆ

ModeratorStaff / Moderator/ 4 years ago  in Social & Random