Topic: Flagging a post for deletion via the API

Posted under e621 Tools and Applications

Can you flag a post for deletion using the API?
The API help only contains information about retrieving the flag history:
https://e621.net/help/api#flag-history

You used to be able to flag posts via the API, but when I tried this today, e621 gave me this error:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>body{background-color:#fff;color:#333;}body,p,ol,ul,td{font-family:verdana,arial,helvetica,sans-serif;font-size:13px;line-height:18px;}pre{background-color:#eee;padding:10px;font-size:11px;}a{color:#000;}a:visited{color:#666;}a:hover{color:#fff;background-color:#000;}</style>
</head>
<body>
<h1>Template is missing</h1>
<p>Missing template post/flag.erb in view path app/views</p>
</body>
</html>

Was this feature removed when the flag menu was changed to multiple-choice?

Updated by savageorange

It's not documented yet but you need an id param, a flag_option param, and in the case of the "repost or inferior version" option, an inferior_parent param which contains the ID of the post to set as the parent before deleting.

flag_option

can be, currently:

  • uploader - Uploader requests deletion
  • inferior - Repost/inferior version of existing post
  • 1 - Artist is on avoid-posting list
  • 2 - Post is paysite material
  • 3 - Uncredited trace
  • 4 - Real-life pornography
  • 5 - File corrupted
  • 6 - Image previously deleted

Updated by anonymous

This might seem like a perverse question, but is there a 'todo list' of undocumented API functions somewhere in the source tree? That kind of thing seems like a good task for someone new to the codebase, that would produce useful docs while also familiarizing them with the structure of the code.

I'm just getting the impression that the actual API docs are pretty bare compared to the current API that the site actually provides.

(Less on-topic Q: What's the main reason the source code is not available to the public yet? Poor data sanitation? (that is, having specific servers and authorization info hardcoded in instead of stored in an independent configuration file) A desire to limit 'clone' sites? Or just 'This code makes my soul scream in horror'?)

Updated by anonymous

  • 1