Topic: How to favorite from api?

Posted under e621 Tools and Applications

What the title says, how do you favorite posts from the api? The docs are a little lackluster on the topic, but I can't find out how to favorite posts from the api. I know that it's possible, or at least used to be. Is anyone able to give me an example endpoint or a generic one? Thanks.

bitWolfy

Former Staff

definitelynotafurry4 said:
What the title says, how do you favorite posts from the api? The docs are a little lackluster on the topic, but I can't find out how to favorite posts from the api. I know that it's possible, or at least used to be. Is anyone able to give me an example endpoint or a generic one? Thanks.

Send a POST request to https://e621.net/favorites.json with data { "post_id": postID }, wheere postID is the numeric ID of the post you want to add to favorites.
Here is how e621 does it: https://github.com/zwagoth/e621ng/blob/159f756514bf26b821abdd8d112122508a58c350/app/javascript/src/javascripts/favorites.js#L34

bitwolfy said:
Send a POST request to https://e621.net/favorites.json with data { "post_id": postID }, wheere postID is the numeric ID of the post you want to add to favorites.
Here is how e621 does it: https://github.com/zwagoth/e621ng/blob/159f756514bf26b821abdd8d112122508a58c350/app/javascript/src/javascripts/favorites.js#L34

idem said:
Make sure you send an authenticated request, otherwise you should get rejected.

Thank you both! The github helped a lot, I didn't know the source was open, so thank you for that.

  • 1