Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

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