legacy-api-documentation icon indicating copy to clipboard operation
legacy-api-documentation copied to clipboard

feature=user_favorites is not working

Open rmandvikar opened this issue 9 years ago • 11 comments

This used to work. But now I see that new favorites are not in the json. Is it deprecated?

https://api.500px.com/v1/photos?feature=user_favorites&username=-{username}&consumer_key={consumer-key}

If deprecated, how do I get a user's favorites now?

rmandvikar avatar Dec 27 '15 02:12 rmandvikar

I think you should now go via the user's Galleries. There will be a gallery called Favorites which you should be able to use.

HayoBaan avatar Dec 28 '15 09:12 HayoBaan

If someone favorites a photo, it does not get added to his/her favorites. The api link above does not show the newly faved photo in json but the existing favorites are present. There is a separate process to add a photo to your own gallery. So how do I get user's favorites (existing ones and newly faved photos) using api?

rmandvikar avatar Dec 28 '15 22:12 rmandvikar

You can't add photos as favorites anymore, you can only like/unlike a photo. You should be able to add to the favorites gallery using galleries endpoints.

moc426 avatar Dec 28 '15 22:12 moc426

What's the galleries endpoint for that? It is not mentioned in the documentation. Ex: GET_photos.md has an example request as https://api.500px.com/v1/photos?feature=popular.

This is not giving me correct results: https://api.500px.com/v1/photos?feature=galleries&username={username}&consumer_key={consumer-key}

rmandvikar avatar Dec 28 '15 23:12 rmandvikar

To get images from gallery -> https://github.com/500px/api-documentation/blob/master/endpoints/galleries/GET_galleries_id_items.md

To add images to gallery -> https://github.com/500px/api-documentation/blob/master/endpoints/galleries/PUT_galleries_id_items.md

moc426 avatar Dec 28 '15 23:12 moc426

I saw those links. Please give me an url for example request like this: https://api.500px.com/v1/photos?feature=user_favorites&username=-{username}&consumer_key={consumer-key}

rmandvikar avatar Dec 28 '15 23:12 rmandvikar

https://api.500px.com/v1/users/{user_id}/galleries/{gallery_id}/items?consumer_key={consumer-key}

So replace user_id, gallery_id is favorites in this case and your consumer key. Should work.

moc426 avatar Dec 28 '15 23:12 moc426

That does not work. I tried below and I get this error for all.

error: "You have not provided a valid user ID.", status: 400

https://api.500px.com/v1/users/tchebotarev/galleries?consumer_key={key}

https://api.500px.com/v1/users/tchebotarev/galleries/favorites?consumer_key={key} https://api.500px.com/v1/users/tchebotarev/galleries/favorites/items?consumer_key={key}

rmandvikar avatar Dec 29 '15 00:12 rmandvikar

User id is a number, not the username.

moc426 avatar Dec 29 '15 00:12 moc426

I see. But that still does not solve my issue. Is there an api endpoint to get a user's liked photos now? Please let me know if I should open a new issue for this question.

rmandvikar avatar Dec 29 '15 00:12 rmandvikar

No, there is no API to get a list of liked photos. @moc426 is correct otherwise in that the Favorites API is deprecated and you should use the Galleries API going forward.

cdmicacc avatar Dec 30 '15 19:12 cdmicacc