Topic: Favouriting posts via the API?

Posted under e621 Tools and Applications

Taking a look at the API docs and I see in the "Changes" section it mentions "When removing favorites/votes/etc posts, DELETE is used instead of POST." however I can't find anything on the docs page about how to do that. Is it possible to favourite/un-favourite a post on behalf of the authenticated user?

pwrpigeon said:
Is it possible to favourite/un-favourite a post on behalf of the authenticated user?

It sure is. Take a look at what network requests your browser fires of when you do it in the browser.

Favoriting a post uses https://e621.net/favorites.json with POST and the id inside the body. The parameter is named post_id
Unfavoriting on the other hand uses https://e621.net/favorites/{id}.json with DELETE and no extra parameters.
There doesn't seem to be a unified endpoint for those, trying to POST to the DELETE endpoint returns a 404.

Hope this helps you.

  • 1