api:posts
Table of Contents
The following includes the details of how to interface with the post records through the API.
Record field format
Name | Type | Details |
---|---|---|
id | integer | >0 |
uploader_id | integer | >0 |
approver_id | integer | >0 |
tag_string | string | |
tag_string_general | string | |
tag_string_artist | string | |
tag_string_copyright | string | |
tag_string_character | string | |
tag_string_meta | string | |
rating | string or null | includes [g, s, q, e] |
parent_id | integer or null | >0 |
source | string | |
md5 | string | |
file_url | string | |
large_file_url | string | |
preview_file_url | string | |
file_ext | string | |
file_size | integer | |
image_width | integer | |
score | integer | |
fav_count | integer | |
tag_count_general | integer | |
tag_count_artist | integer | |
tag_count_copyright | integer | |
tag_count_character | integer | |
tag_count_meta | integer | |
last_comment_bumped_at | timestamp or null | |
last_noted_at | timestamp or null | |
has_children | boolean | |
image_height | integer | |
created_at | timestamp | |
updated_at | timestamp |
Associated attributes
Name | Type | Number | Availability | Details |
---|---|---|---|---|
uploader | user | single | required | |
updater | user | single | required | |
approver | user | single | optional | |
parent | post | single | optional | |
children | post | multiple | optional | |
artist_commentary | artist_commentary | single | optional | |
notes | note | multiple | optional | |
comments | comment | multiple | optional | |
flags | post flag | multiple | optional | |
appeals | post appeals | multiple | optional | |
approvals | post approval | multiple | optional | |
replacements | post replacement | multiple | optional | |
pixiv_ugoira_frame_data | Pixiv ugoira frame data | single | optional |
Nomenclature
- Plural form: "posts"
- Used in the URL pathname
- Singular form: "post"
- Used for write parameters (Help:API Write Requests)
- Versions: API:Post versions
Actions
These are the various actions that can be done with upload records.
Index
HTTP Method | GET or POST [1] |
Base URL | /posts.json |
Type | read request |
Description | The default order is ID descending |
Index parameters
tags
- The post query to search for using tags and metatags (Help:Cheatsheet).post[tags]
can also be used.random
- Selects a random sampling under the post query.format
- Chooses which format to return. Can be: html, json, xml, atom.md5
- Search for an MD5 match. Takes priority over all other parameters.
Show
HTTP Method | GET or POST [1] |
Base URL | /posts/$id.json |
Type | read request |
Description | $id is the post ID |
Create
HTTP method | POST |
Base URL | /posts.json |
Type | write request |
Description |
Create parameters
- Mandatory:
upload_media_asset_id
- Optional:
tag_string
rating
parent_id
source
artist_commentary_title
artist_commentary_desc
translated_commentary_title
translated_commentary_desc
is_pending
- only matters for users with unrestricted uploads.
Update
HTTP Method | PUT/PATCH |
Base URL | /posts/$id.json |
Type | write request |
Description |
Update parameters
- Optional:
tag_string
old_tag_string
parent_id
old_parent_id
source
old_source
rating
old_rating
has_embedded_notes
Revert
HTTP Method | PUT/PATCH |
Base URL | /posts/$id/revert.json |
Type | write request |
Description |
Revert parameters
- Required:
- version_id - The post version ID to revert to.
See also
[1] See Help:API read requests for more information.