The following includes the details of how to interface with the tag implication records through the API.
Record field format
| Name | Type | Details |
|---|
| [code]id[/code] | integer | >0 |
| [code]antecedent_name[/code] | string | |
| [code]consequent_name[/code] | string | |
| [code]status[/code] | string | includes [active, deleted, retired] |
| [code]reason[/code] | string | unused |
| [code]forum_topic_id[/code] | integer | >0 or null |
| [code]forum_post_id[/code] | integer | >0 or null |
| [code]creator_id[/code] | integer | >0 |
| [code]approver_id[/code] | integer | >0 or null |
| [code]created_at[/code] | timestamp | |
| [code]updated_at[/code] | timestamp | |
| Name | Type | Number | Availability | Details |
|---|
| [code]creator[/code] | user | single | required | User that created the implication. |
| [code]approver[/code] | user | single | optional | User that approved the implication. |
| [code]forum_topic[/code] | forum topic | single | optional | Forum topic where the implication was discussed. |
| [code]forum_post[/code] | forum post | single | optional | Forum post which started the implication discussion. |
| [code]antecedent_tag[/code] | tag | single | required | Tag of the antecedent. |
| [code]consequent_tag[/code] | tag | single | required | Tag of the consequent. |
| [code]antecedent_wiki[/code] | wiki page | single | optional | Wiki page of the antecedent. |
| [code]consequent_wiki[/code] | wiki page | single | optional | Wiki page of the consequent. |
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
| HTTP Method | GET |
| Base URL | [code]/tag_implications.json[/code] |
| Type | read request |
| Description | The default order is ID descending. |
All of the following are standard attributes with all of their available formats and qualifiers.
- [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
| HTTP Method | GET |
| Base URL | [code]/tag_implications/$id.json[/code] |
| Type | read request |
| Description | [code]$id[/code] is the forum post ID. |
Delete
| HTTP Method | DELETE |
| Base URL | [code]/tag_implications/$id.json[/code] |
| Type | write request |
| Description | [code]$id[/code] is the forum post ID.
Restricted to Admin+. |
See also
External links
| Controller | <https://github.com/danbooru/danbooru/blob/master/app/controllers/tag_implications_controller.rb> |
| Model | <https://github.com/danbooru/danbooru/blob/master/app/models/tag_relationship.rb>
<https://github.com/danbooru/danbooru/blob/master/app/models/tag_implication.rb> |
| Policy | <https://github.com/danbooru/danbooru/blob/master/app/policies/tag_implication_policy.rb> |