api:posts
The following includes the details of how to interface with the upload 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 [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 | |
pool_string |
string | |
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 | |
is_favorited |
boolean | |
is_note_locked |
boolean | |
is_rating_locked |
boolean | |
is_status_locked |
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 | |
upload |
upload | single | optional | Upload records only last 1 day. |
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
Posts are created with uploads (API:Uploads).
Update
HTTP Method | PUT/PATCH |
Base URL | /posts.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
- Restricted to Builder+
is_rating_locked
is_note_locked
- Restricted to Admin
is_status_locked
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.