The Stack Exchange API has a couple of calls that return a list of flag_option
objects.
These objects contain a couple of properties that can be used to identify the flag you need.
For example, when I want to cast a spam flag from an app, I used to look for a flag option with an title
equal to "spam"
:
{"has_flagged":false,"option_id":46534,"title":"spam"},
This approach went down the drain when a user tried to cast a flag on a non-English SE site, since their flag options look a little different:
{"has_flagged":false,"option_id":46534,"title":"contenido no deseado"},
Now, the option_id
is something else I can identify the proper option from, but these aren't documented anywhere (that I know of).
I'd rather not rely on my own interpretation of these ids from a couple of API calls, since mistakes in flagging just aren't acceptable.
TL;DR: Can these option_id
s be documented on the flag_options
page, or in an answer here?
Even these flag Ids aren't stable, and could change at any time.
Feature Request:
Please add an API route that tells me what option_id
is used for what type of flag, for a specific site. (Where "type of flag" is a constant):
A call that'd return something like this:
{
site: 'siteName',
flag_options:{
spam: x,
rude_abusive: y,
not_an_answer: z,
<...>
}
}