ScrollX Tag Page

Api:Post Flags

0 posts0 sourcesWiki updated 1/22/2025
Browse Full Gallery →

About Api:Post Flags

Table of Contents

The following includes the details of how to interface with the post flag records through the API.

Record field format

[table]

[thead]

[tr]

[th]Name[/th]

[th]Type[/th]

[th]Details[/th]

[/tr]

[/thead]

[tbody]

[tr]

[td][code]id[/code][/td]

[td]integer[/td]

[td]>0[/td]

[/tr]

[tr]

[td][code]post_id[/code][/td]

[td]integer[/td]

[td]>0[/td]

[/tr]

[tr]

[td][code]reason[/code][/td]

[td]string[/td]

[td][/td]

[/tr]

[tr]

[td][code]status[/code][/td]

[td]enum[/td]

[td]See Status table for list of acceptable values.[/td]

[/tr]

[tr]

[td][code]is_resolved[/code][/td]

[td]boolean[/td]

[td][/td]

[/tr]

[tr]

[td][code]creator_id[/code][/td]

[td]integer[/td]

[td]>0, limited to Moderator+ or the flag creator[/td]

[/tr]

[tr]

[td][code]created_at[/code][/td]

[td]timestamp[/td]

[td][/td]

[/tr]

[tr]

[td][code]updated_at[/code][/td]

[td]timestamp[/td]

[td][/td]

[/tr]

[/tbody]

[/table]

Status

[table]

[thead]

[tr]

[th]Value[/th]

[th]Enum[/th]

[/tr]

[/thead]

[tbody]

[tr]

[td]0[/td]

[td]pending[/td]

[/tr]

[tr]

[td]1[/td]

[td]succeeded[/td]

[/tr]

[tr]

[td]2[/td]

[td]rejected[/td]

[/tr]

[/tbody]

[/table]

Associated attributes

[table]

[thead]

[tr]

[th]Name[/th]

[th]Type[/th]

[th]Number[/th]

[th]Availability[/th]

[th]Details[/th]

[/tr]

[/thead]

[tbody]

[tr]

[td][code]post[/code][/td]

[td]post[/td]

[td]single[/td]

[td]required[/td]

[td]Post that the flag belongs to.[/td]

[/tr]

[/tbody]

[/table]

Nomenclature

  • Plural form: "post flags"
  • Used in the URL pathname
  • Singular form: "post flag"
  • Used for write parameters (Help:API Write Requests)
  • Versions: none

Index

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]GET[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td][code]/post_flags.json[/code][/td]

[/tr]

[tr]

[td]Type[/td]

[td]read request[/td]

[/tr]

[tr]

[td]Description[/td]

[td]The default order is ID descending.[/td]

[/tr]

[/tbody]

[/table]

Search attributes

All of the following are standard attributes with all of their available formats and qualifiers.

Special search parameters

  • [code]reason_matches[/code] - Case-insensitive wildcard search on the reason field.
  • [code]creator_id[/code] - Searches for flags by creator ID. Single ID only.
  • [code]creator_name[/code] - Searches for flags by creator name. Single name only.
  • [code]category_matches[/code] - Can be: normal, unapproved, rejected, deleted.

Search order

The search order can only be changed with the custom parameter.

Show

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]GET[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td][code]/post_flags/$id.json[/code][/td]

[/tr]

[tr]

[td]Type[/td]

[td]read request[/td]

[/tr]

[tr]

[td]Description[/td]

[td][code]$id[/code] is the post flag ID.[/td]

[/tr]

[/tbody]

[/table]

Create

[table]

[tbody]

[tr]

[td]HTTP Method[/td]

[td]POST[/td]

[/tr]

[tr]

[td]Base URL[/td]

[td][code]/post_flags.json[/code][/td]

[/tr]

[tr]

[td]Type[/td]

[td]write request[/td]

[/tr]

[/tbody]

[/table]

Create parameters

  • Required:
  • [code]post_id[/code]
  • [code]reason[/code]

See also

[table]

[tbody]

[tr]

[td]Controller[/td]

[td]<https://github.com/danbooru/danbooru/blob/master/app/controllers/post_flags_controller.rb>[/td]

[td][/td]

[/tr]

[tr]

[td]Model[/td]

[td]<https://github.com/danbooru/danbooru/blob/master/app/models/post_flag.rb>[/td]

[/tr]

[tr]

[td]Policy[/td]

[td]<https://github.com/danbooru/danbooru/blob/master/app/policies/post_flag_policy.rb>[/td]

[/tr]

[/tbody]

[/table]

Page 1