The following includes the details of how to interface with the post version 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]tags[/code][/td]
[td]string[/td]
[td]space delineated, tag format[/td]
[/tr]
[tr]
[td][code]added_tags[/code][/td]
[td]array[/td]
[td]string, tag format[/td]
[/tr]
[tr]
[td][code]removed_tags[/code][/td]
[td]array[/td]
[td]string, tag format[/td]
[/tr]
[tr]
[td][code]rating[/code][/td]
[td]string[/td]
[td][g, s, q, e][/td]
[/tr]
[tr]
[td][code]parent_id[/code][/td]
[td]integer[/td]
[td]>0 or null[/td]
[/tr]
[tr]
[td][code]source[/code][/td]
[td]string[/td]
[td][/td]
[/tr]
[tr]
[td][code]rating_changed[/code][/td]
[td]boolean[/td]
[td][/td]
[/tr]
[tr]
[td][code]parent_changed[/code][/td]
[td]boolean[/td]
[td][/td]
[/tr]
[tr]
[td][code]source_changed[/code][/td]
[td]boolean[/td]
[td][/td]
[/tr]
[tr]
[td][code]version[/code][/td]
[td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td][code]updater_id[/code][/td]
[td]integer[/td]
[td]>0[/td]
[/tr]
[tr]
[td][code]updated_at[/code][/td]
[td]timestamp[/td]
[td][/td]
[/tr]
[tr]
[td][code]updater_addr_ip[/code][/td]
[td]inet[/td]
[td]Limited to Moderator+[/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][/td]
[/tr]
[tr]
[td][code]updater[/code][/td]
[td]user[/td]
[td]single[/td]
[td]required[/td]
[td][/td]
[/tr]
[/tbody]
[/table]
Nomenclature
- Plural form: "post_versions"
- Used in the URL pathname
- Singular form: "post_version"
- Unused
- Version of: API:Posts
Index
[table]
[tbody]
[tr]
[td]HTTP Method[/td]
[td]GET[/td]
[/tr]
[tr]
[td]Base URL[/td]
[td][code]/post_versions.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]post_id[/code]
- [code]parent_id[/code]
- [code]updater_id[/code]
- [code]version[/code]
- [code]updated_at[/code]
- Text syntax
- [code]tags[/code]
- [code]rating[/code]
- [code]source[/code]
- Boolean syntax
- [code]rating_changed[/code]
- [code]parent_changed[/code]
- [code]source_changed[/code]
- Array syntax
- [code]added_tags[/code]
- [code]removed_tags[/code]
Special search parameters
- [code]all_changed_tags[/code] - Search where all tags in the list must be either an added tag or removed tag
- The list of tags is space-delineated
- [code]changed_tags[/code] performs the same search
- [code]any_changed_tags[/code] - Search where at least one tag in the list must be either an added tag or removed tag
- The list of tags is space-delineated
- [code]tag_matches[/code] - Case-insensitive search of the [code]tag[/code] string
- If asterisks ( * ) are missing from the input, it adds an asterisk to either side of the tag
- It ignores all input after the first word, so only one word can be searched
- [code]updater_name[/code] - Searches by updater name instead of updater ID
- [code]is_new[/code] - Boolean syntax
- Shorthand search for [code]version=1[/code] or [code]version=>1[/code]
See also
External links
[table]
[tbody]
[tr]
[td]Controller[/td]
[td]<https://github.com/danbooru/danbooru/blob/master/app/controllers/post_versions_controller.rb>[/td]
[td][/td]
[/tr]
[tr]
[td]Model[/td]
[td]<https://github.com/danbooru/danbooru/blob/master/app/models/post_version.rb>[/td]
[/tr]
[tr]
[td]Policy[/td]
[td]<https://github.com/danbooru/danbooru/blob/master/app/policies/post_version_policy.rb>[/td]
[/tr]
[/tbody]
[/table]