The following includes the details of how to interface with the tag implication 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]antecedent_name[/code][/td]
[td]string[/td]
[td][/td]
[/tr]
[tr]
[td][code]consequent_name[/code][/td]
[td]string[/td]
[td][/td]
[/tr]
[tr]
[td][code]status[/code][/td]
[td]string[/td]
[td]includes [active, deleted, retired][/td]
[/tr]
[tr]
[td][code]reason[/code][/td]
[td]string[/td]
[td]unused[/td]
[/tr]
[tr]
[td][code]forum_topic_id[/code][/td]
[td]integer[/td]
[td]>0 or null[/td]
[/tr]
[tr]
[td][code]forum_post_id[/code][/td]
[td]integer[/td]
[td]>0 or null[/td]
[/tr]
[tr]
[td][code]creator_id[/code][/td]
[td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td][code]approver_id[/code][/td]
[td]integer[/td]
[td]>0 or null[/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]
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]creator[/code][/td]
[td]user[/td]
[td]single[/td]
[td]required[/td]
[td]User that created the implication.[/td]
[/tr]
[tr]
[td][code]approver[/code][/td]
[td]user[/td]
[td]single[/td]
[td]optional[/td]
[td]User that approved the implication.[/td]
[/tr]
[tr]
[td][code]forum_topic[/code][/td]
[td]forum topic[/td]
[td]single[/td]
[td]optional[/td]
[td]Forum topic where the implication was discussed.[/td]
[/tr]
[tr]
[td][code]forum_post[/code][/td]
[td]forum post[/td]
[td]single[/td]
[td]optional[/td]
[td]Forum post which started the implication discussion.[/td]
[/tr]
[tr]
[td][code]antecedent_tag[/code][/td]
[td]tag[/td]
[td]single[/td]
[td]required[/td]
[td]Tag of the antecedent.[/td]
[/tr]
[tr]
[td][code]consequent_tag[/code][/td]
[td]tag[/td]
[td]single[/td]
[td]required[/td]
[td]Tag of the consequent.[/td]
[/tr]
[tr]
[td][code]antecedent_wiki[/code][/td]
[td]wiki page[/td]
[td]single[/td]
[td]optional[/td]
[td]Wiki page of the antecedent.[/td]
[/tr]
[tr]
[td][code]consequent_wiki[/code][/td]
[td]wiki page[/td]
[td]single[/td]
[td]optional[/td]
[td]Wiki page of the consequent.[/td]
[/tr]
[/tbody]
[/table]
Nomenclature
- Plural form: "tag_implications"
- Used in the URL pathname
- Singular form: "tag_implication"
- 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]/tag_implications.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.
- Number syntax
- [code]id[/code]
- [code]created_at[/code]
- [code]updated_at[/code]
- String syntax
- [code]antecedent_name[/code]
- [code]consequent_name[/code]
- User syntax
- [code]creator[/code]
- [code]approver[/code]
- Chaining syntax
- [code]forum_topic[/code]
- [code]forum_post[/code]
Special search parameters
- [code]name_matches[/code] - Case-insensitive wildcard search on the antecedent name or consequent name fields.
- [code]status[/code] - Case-insensitive search on the status field.
- [code]category[/code] - Searches on the category of the consequent tag, with support for multiple categories being space-delimited.
- [code]implied_from[/code] - List of tag implication ancestors of the antecedent tag.
- [code]implied_to[/code] - List of tag implication descendants of the consequent tag.
Search order
Using the search parameter [code]order[/code] with one of the following values changes the order of the results.
- [code]created_at[/code] - Orders by created_at descending.
- [code]updated_at[/code] - Orders by updated_at descending.
- [code]name[/code] - Alphabetical order on the antecedent, then alphabetical order on the consequent.
- [code]tag_count[/code] - Orders by post count of the consequent tag, then alphabetical order on the antecedent, then alphabetical order on the consequent.
- [code]custom[/code] - See here for more info.
Show
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]GET[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td][code]/tag_implications/$id.json[/code][/td]
[/tr]
[tr]
[td]Type[/td]
[td]read request[/td]
[/tr]
[tr]
[td]Description[/td]
[td][code]$id[/code] is the forum post ID.[/td]
[/tr]
[/tbody]
[/table]
Delete
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]DELETE[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td][code]/tag_implications/$id.json[/code][/td]
[/tr]
[tr]
[td]Type[/td]
[td]write request[/td]
[/tr]
[tr]
[td]Description[/td]
[td][code]$id[/code] is the forum post ID.
Restricted to Admin+.[/td]
[/tr]
[/tbody]
[/table]
See also
External links
[table]
[tbody]
[tr]
[td]Controller[/td]
[td]<https://github.com/danbooru/danbooru/blob/master/app/controllers/tag_implications_controller.rb>[/td]
[/tr]
[tr]
[td]Model[/td]
[td]<https://github.com/danbooru/danbooru/blob/master/app/models/tag_relationship.rb>
<https://github.com/danbooru/danbooru/blob/master/app/models/tag_implication.rb>[/td]
[/tr]
[tr]
[td]Policy[/td]
[td]<https://github.com/danbooru/danbooru/blob/master/app/policies/tag_implication_policy.rb>[/td]
[/tr]
[/tbody]
[/table