Topic: API: Faving, Voting and Commenting

Posted under General

Yes they are :)

+Fav: "https://e621.net/favorite/create.json?id=[post id]"
-Fav: "https://e621.net/favorite/destroy.json?id=[post id]"

+Fav and -Fav are both POST requests where you'll have to read the "succes" field after the response, optionally reading "score" to check the new value and "favorited_users" for the new list.

Voting in a post is on the API (scroll a bit up)

The error you're getting for commenting is probably because you're not supplying one or both of these parameters:

Full URL is "http://e621.net/comment/create?comment[post_id]=[post id]&comment[body]=[text]"

  • comment[post_id]: The post the womment will be made on

comment[body]: The actual content of your comment, properly URL encoded before sending.

(brackets are %5B and %5D respectively, if you do it manually)

Inspect element can be very helpful in situations like these. That's how I've gotten some stuff to work on my script :D

Also, make sure you're logged in with the client you're using, since these calls are user specific and some require a certain user level (20, 30, 33, 40, 50. In that page's order. You can read any page's variable "user_level" in your browser and compare it against those numbers before doing anything).
Unless you're writing an userscript, which will take on your browser's already logged in cookies.

Updated by anonymous

beastarman said:
Hey, I have one more question. Is there any way for me to get a list of pools based on a post id?

For instance, the post #473176. How can I retrieve the id of the pool #4021.

I tried https://e621.net/pool/index.json?post_id=473176, but it did not work.

/pool/index doesn't accept a post_id, it's for searching pools by name/description.

/post/show ought to provide this information, as the api help specifies, but it doesn't. I've posted a bug report.

Updated by anonymous

  • 1