Announcements

Help Wizard

Step 1

NEXT STEP

Best/most correct way to check if a playlist is owned by the current user?

Solved!

Best/most correct way to check if a playlist is owned by the current user?

Hello!

 

If I use the "Get Current User's Playlists" endpoint, what's the best/most correct way to check if the owner is the current user? Right now I'm checking if the ID matches that of the ID I get from "Get Current User's Profile", which feels correct, but I just wanted to make sure.

 

Thank you!

Anton.

Reply

Accepted Solutions
Marked as solution

The way you are doing it is fine.

 

You could also first get the current user's id from /me and then call /users/{id}/playlists instead of calling /me/playlists and then getting the current user's id, but neither approach is better or worse.

View solution in original post

2 Replies
Marked as solution

The way you are doing it is fine.

 

You could also first get the current user's id from /me and then call /users/{id}/playlists instead of calling /me/playlists and then getting the current user's id, but neither approach is better or worse.

What tomjaimz said, but you can also check the current user's ID vs that of the owner fields of a playlist, while still using /me/playlists. And like tomjaimz said, neither approach is better or worse. 

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