feature=user_favorites is not working
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?
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.
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?
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.
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}
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
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}
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.
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}
User id is a number, not the username.
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.
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.