Updated and polished documentation

This commit is contained in:
Luxray5474 2020-08-24 21:01:04 -04:00
parent 955328735f
commit 04169c6942
2 changed files with 390 additions and 257 deletions

View file

@ -23,12 +23,12 @@
<td>uploaded by given user (accepts wildcards)</td> <td>uploaded by given user (accepts wildcards)</td>
</tr> </tr>
<tr> <tr>
<td><code>upload</code></td> <td><code> upload</code></td>
<td>alias of <code>upload</code></td> <td>alias of <code>uploader</code></td>
</tr> </tr>
<tr> <tr>
<td><code>submit</code></td> <td><code> submit</code></td>
<td>alias of <code>upload</code></td> <td>alias of <code>uploader</code></td>
</tr> </tr>
<tr> <tr>
<td><code>comment</code></td> <td><code>comment</code></td>
@ -107,27 +107,27 @@
<td>having given aspect ratio (image width / image height)</td> <td>having given aspect ratio (image width / image height)</td>
</tr> </tr>
<tr> <tr>
<td><code>image-ar</code></td> <td><code> image-ar</code></td>
<td>alias of <code>image-aspect-ratio</code></td> <td>alias of <code>image-aspect-ratio</code></td>
</tr> </tr>
<tr> <tr>
<td><code>width</code></td> <td><code> width</code></td>
<td>alias of <code>image-width</code></td> <td>alias of <code>image-width</code></td>
</tr> </tr>
<tr> <tr>
<td><code>height</code></td> <td><code> height</code></td>
<td>alias of <code>image-height</code></td> <td>alias of <code>image-height</code></td>
</tr> </tr>
<tr> <tr>
<td><code>area</code></td> <td><code> area</code></td>
<td>alias of <code>image-area</code></td> <td>alias of <code>image-area</code></td>
</tr> </tr>
<tr> <tr>
<td><code>aspect-ratio</code></td> <td><code> aspect-ratio</code></td>
<td>alias of <code>image-aspect-ratio</code></td> <td>alias of <code>image-aspect-ratio</code></td>
</tr> </tr>
<tr> <tr>
<td><code>ar</code></td> <td><code> ar</code></td>
<td>alias of <code>image-aspect-ratio</code></td> <td>alias of <code>image-aspect-ratio</code></td>
</tr> </tr>
<tr> <tr>
@ -135,31 +135,47 @@
<td>posted at given date</td> <td>posted at given date</td>
</tr> </tr>
<tr> <tr>
<td><code>creation-time</code></td> <td><code> creation-time</code></td>
<td>alias of <code>creation-date</code></td> <td>alias of <code>creation-date</code></td>
</tr> </tr>
<tr> <tr>
<td><code>date</code></td> <td><code> date</code></td>
<td>alias of <code>creation-date</code></td> <td>alias of <code>creation-date</code></td>
</tr> </tr>
<tr> <tr>
<td><code>time</code></td> <td><code> time</code></td>
<td>alias of <code>creation-date</code></td> <td>alias of <code>creation-date</code></td>
</tr> </tr>
<tr>
<td><code>file-last-modified-time</code></td>
<td>source file last modified at a given date</td>
</tr>
<tr>
<td><code> file-modified</code></td>
<td>alias of <code>file-last-modified-time</code></td>
</tr>
<tr>
<td><code> source-modified</code></td>
<td>alias of <code>file-last-modified-time</code></td>
</tr>
<tr>
<td><code> flmt</code></td>
<td>alias of <code>file-last-modified-time</code></td>
</tr>
<tr> <tr>
<td><code>last-edit-date</code></td> <td><code>last-edit-date</code></td>
<td>edited at given date</td> <td>edited at given date</td>
</tr> </tr>
<tr> <tr>
<td><code>last-edit-time</code></td> <td><code> last-edit-time</code></td>
<td>alias of <code>last-edit-date</code></td> <td>alias of <code>last-edit-date</code></td>
</tr> </tr>
<tr> <tr>
<td><code>edit-date</code></td> <td><code> edit-date</code></td>
<td>alias of <code>last-edit-date</code></td> <td>alias of <code>last-edit-date</code></td>
</tr> </tr>
<tr> <tr>
<td><code>edit-time</code></td> <td><code> edit-time</code></td>
<td>alias of <code>last-edit-date</code></td> <td>alias of <code>last-edit-date</code></td>
</tr> </tr>
<tr> <tr>
@ -167,7 +183,7 @@
<td>commented at given date</td> <td>commented at given date</td>
</tr> </tr>
<tr> <tr>
<td><code>comment-time</code></td> <td><code> comment-time</code></td>
<td>alias of <code>comment-date</code></td> <td>alias of <code>comment-date</code></td>
</tr> </tr>
<tr> <tr>
@ -175,7 +191,7 @@
<td>last favorited at given date</td> <td>last favorited at given date</td>
</tr> </tr>
<tr> <tr>
<td><code>fav-time</code></td> <td><code> fav-time</code></td>
<td>alias of <code>fav-date</code></td> <td>alias of <code>fav-date</code></td>
</tr> </tr>
<tr> <tr>
@ -183,7 +199,7 @@
<td>featured at given date</td> <td>featured at given date</td>
</tr> </tr>
<tr> <tr>
<td><code>feature-time</code></td> <td><code> feature-time</code></td>
<td>alias of <code>feature-time</code></td> <td>alias of <code>feature-time</code></td>
</tr> </tr>
<tr> <tr>
@ -191,7 +207,7 @@
<td>having given safety</td> <td>having given safety</td>
</tr> </tr>
<tr> <tr>
<td><code>rating</code></td> <td><code> rating</code></td>
<td>alias of <code>safety</code></td> <td>alias of <code>safety</code></td>
</tr> </tr>
</tbody> </tbody>
@ -254,15 +270,15 @@
<td>largest images first</td> <td>largest images first</td>
</tr> </tr>
<tr> <tr>
<td><code>width</code></td> <td><code> width</code></td>
<td>alias of <code>image-width</code></td> <td>alias of <code>image-width</code></td>
</tr> </tr>
<tr> <tr>
<td><code>height</code></td> <td><code> height</code></td>
<td>alias of <code>image-height</code></td> <td>alias of <code>image-height</code></td>
</tr> </tr>
<tr> <tr>
<td><code>area</code></td> <td><code> area</code></td>
<td>alias of <code>image-area</code></td> <td>alias of <code>image-area</code></td>
</tr> </tr>
<tr> <tr>
@ -274,27 +290,43 @@
<td>alias of <code>creation-date</code></td> <td>alias of <code>creation-date</code></td>
</tr> </tr>
<tr> <tr>
<td><code>date</code></td> <td><code> date</code></td>
<td>alias of <code>creation-date</code></td> <td>alias of <code>creation-date</code></td>
</tr> </tr>
<tr> <tr>
<td><code>time</code></td> <td><code> time</code></td>
<td>alias of <code>creation-date</code></td> <td>alias of <code>creation-date</code></td>
</tr> </tr>
<tr>
<td><code>file-last-modified-time</code></td>
<td>newest to oldest based on source file's last modified time</td>
</tr>
<tr>
<td><code> file-modified</code></td>
<td>alias of <code>file-last-modified-time</code></td>
</tr>
<tr>
<td><code> source-modified</code></td>
<td>alias of <code>file-last-modified-time</code></td>
</tr>
<tr>
<td><code> flmt</code></td>
<td>alias of <code>file-last-modified-time</code></td>
</tr>
<tr> <tr>
<td><code>last-edit-date</code></td> <td><code>last-edit-date</code></td>
<td>like <code>creation-date</code>, only looks at last edit time</td> <td>like <code>creation-date</code>, only looks at last edit time</td>
</tr> </tr>
<tr> <tr>
<td><code>last-edit-time</code></td> <td><code> last-edit-time</code></td>
<td>alias of <code>last-edit-date</code></td> <td>alias of <code>last-edit-date</code></td>
</tr> </tr>
<tr> <tr>
<td><code>edit-date</code></td> <td><code> edit-date</code></td>
<td>alias of <code>last-edit-date</code></td> <td>alias of <code>last-edit-date</code></td>
</tr> </tr>
<tr> <tr>
<td><code>edit-time</code></td> <td><code> edit-time</code></td>
<td>alias of <code>last-edit-date</code></td> <td>alias of <code>last-edit-date</code></td>
</tr> </tr>
<tr> <tr>
@ -302,7 +334,7 @@
<td>recently commented by anyone</td> <td>recently commented by anyone</td>
</tr> </tr>
<tr> <tr>
<td><code>comment-time</code></td> <td><code> comment-time</code></td>
<td>alias of <code>comment-date</code></td> <td>alias of <code>comment-date</code></td>
</tr> </tr>
<tr> <tr>
@ -310,7 +342,7 @@
<td>recently added to favorites by anyone</td> <td>recently added to favorites by anyone</td>
</tr> </tr>
<tr> <tr>
<td><code>fav-time</code></td> <td><code> fav-time</code></td>
<td>alias of <code>fav-date</code></td> <td>alias of <code>fav-date</code></td>
</tr> </tr>
<tr> <tr>
@ -318,7 +350,7 @@
<td>recently featured</td> <td>recently featured</td>
</tr> </tr>
<tr> <tr>
<td><code>feature-time</code></td> <td><code> feature-time</code></td>
<td>alias of <code>feature-time</code></td> <td>alias of <code>feature-time</code></td>
</tr> </tr>
</tbody> </tbody>

View file

@ -337,9 +337,11 @@ data.
- **Description** - **Description**
Creates a new tag category using specified parameters. Name must match Creates a new tag category using specified parameters.
`tag_category_name_regex` from server's configuration. First category
created becomes the default category. * Name must match `tag_category_name_regex` from tje server's configuration.
* First category created becomes the default category.
## Updating tag category ## Updating tag category
- **Request** - **Request**
@ -371,10 +373,12 @@ data.
- **Description** - **Description**
Updates an existing tag category using specified parameters. Name must Updates an existing tag category using specified parameters.
match `tag_category_name_regex` from server's configuration. All fields
except the [`version`](#versioning) are optional - update concerns only * Name must match `tag_category_name_regex` from server's configuration.
provided fields.
* All fields except the [`version`](#versioning) are optional - update
concerns only provided fields.
## Getting tag category ## Getting tag category
- **Request** - **Request**
@ -547,15 +551,21 @@ data.
- **Description** - **Description**
Creates a new tag using specified parameters. Names, suggestions and Creates a new tag using specified parameters.
implications must match `tag_name_regex` from server's configuration.
Category must exist and is the same as `name` field within * Names, suggestions and implications must match `tag_name_regex` from
[`<tag-category>` resource](#tag-category). Suggestions and implications the server's configuration.
are optional. If specified implied tags or suggested tags do not exist yet,
they will be automatically created. Tags created automatically have no * Category must exist and must be the same as `name` field within
implications, no suggestions, one name and their category is set to the [`<tag-category>` resource](#tag-category).
first tag category found. If there are no tag categories established yet,
an error will be thrown. * Suggestions and implications are optional.
* If specified implied tags or suggested tags do not exist yet, they will
be automatically created. Tags created automatically have no implications,
no suggestions, one name and their category is set to the first tag
category found. If there are no tag categories established yet, an error
will be thrown.
## Updating tag ## Updating tag
- **Request** - **Request**
@ -592,15 +602,21 @@ data.
- **Description** - **Description**
Updates an existing tag using specified parameters. Names, suggestions and Updates an existing tag using specified parameters.
implications must match `tag_name_regex` from server's configuration.
Category must exist and is the same as `name` field within * Names, suggestions and implications must match `tag_name_regex` from
[`<tag-category>` resource](#tag-category). If specified implied tags or the server's configuration.
suggested tags do not exist yet, they will be automatically created. Tags
created automatically have no implications, no suggestions, one name and * Category must exist and must be the the same as `name` field within
their category is set to the first tag category found. All fields except [`<tag-category>` resource](#tag-category).
the [`version`](#versioning) are optional - update concerns only provided
fields. * If specified implied tags or suggested tags do not exist yet, they will
be automatically created. Tags created automatically have no implications,
no suggestions, one name and their category is set to the first tag
category found.
* All fields except the [`version`](#versioning) are optional - update
concerns only provided fields.
## Getting tag ## Getting tag
- **Request** - **Request**
@ -712,9 +728,12 @@ data.
- **Description** - **Description**
Lists siblings of given tag, e.g. tags that were used in the same posts as Lists siblings of given tag, e.g. tags that were used in the same posts as
the given tag. `occurrences` field signifies how many times a given sibling the given tag. `occurrences`
appears with given tag. Results are sorted by occurrences count and the
list is truncated to the first 50 elements. Doesn't use paging. * Field signifies how many times a given sibling appears with given tag.
* Results are sorted by occurrences count and the list is truncated to the
first 50 elements. Doesn't use paging.
## Listing posts ## Listing posts
- **Request** - **Request**
@ -740,88 +759,96 @@ data.
**Named tokens** **Named tokens**
| `<key>` | Description | | `<key>` | Description |
| -------------------- | ---------------------------------------------------------- | | ------------------------- | ---------------------------------------------------------- |
| `id` | having given post number | | `id` | having given post number |
| `tag` | having given tag (accepts wildcards) | | `tag` | having given tag (accepts wildcards) |
| `score` | having given score | | `score` | having given score |
| `uploader` | uploaded by given user (accepts wildcards) | | `uploader` | uploaded by given user (accepts wildcards) |
| `upload` | alias of upload | | `upload` | alias of upload |
| `submit` | alias of upload | | `submit` | alias of upload |
| `comment` | commented by given user (accepts wildcards) | | `comment` | commented by given user (accepts wildcards) |
| `fav` | favorited by given user (accepts wildcards) | | `fav` | favorited by given user (accepts wildcards) |
| `pool` | belonging to the pool with the given ID | | `pool` | belonging to the pool with the given ID |
| `tag-count` | having given number of tags | | `tag-count` | having given number of tags |
| `comment-count` | having given number of comments | | `comment-count` | having given number of comments |
| `fav-count` | favorited by given number of users | | `fav-count` | favorited by given number of users |
| `note-count` | having given number of annotations | | `note-count` | having given number of annotations |
| `note-text` | having given note text (accepts wildcards) | | `note-text` | having given note text (accepts wildcards) |
| `relation-count` | having given number of relations | | `relation-count` | having given number of relations |
| `feature-count` | having been featured given number of times | | `feature-count` | having been featured given number of times |
| `type` | given type of posts. `<value>` can be either `image`, `animation` (or `animated` or `anim`), `flash` (or `swf`) or `video` (or `webm`). | | `type` | given type of posts. `<value>` can be either `image`, `animation` (or `animated` or `anim`), `flash` (or `swf`) or `video` (or `webm`). |
| `content-checksum` | having given SHA1 checksum | | `content-checksum` | having given SHA1 checksum |
| `file-size` | having given file size (in bytes) | | `file-size` | having given file size (in bytes) |
| `image-width` | having given image width (where applicable) | | `image-width` | having given image width (where applicable) |
| `image-height` | having given image height (where applicable) | | `image-height` | having given image height (where applicable) |
| `image-area` | having given number of pixels (image width * image height) | | `image-area` | having given number of pixels (image width * image height) |
| `image-aspect-ratio` | having given aspect ratio (image width / image height) | | `image-aspect-ratio` | having given aspect ratio (image width / image height) |
| `image-ar` | alias of `image-aspect-ratio` | | `image-ar` | alias of `image-aspect-ratio` |
| `width` | alias of `image-width` | | `width` | alias of `image-width` |
| `height` | alias of `image-height` | | `height` | alias of `image-height` |
| `area` | alias of `image-area` | | `area` | alias of `image-area` |
| `ar` | alias of `image-aspect-ratio` | | `ar` | alias of `image-aspect-ratio` |
| `aspect-ratio` | alias of `image-aspect-ratio` | | `aspect-ratio` | alias of `image-aspect-ratio` |
| `creation-date` | posted at given date | | `creation-date` | posted at given date |
| `creation-time` | alias of `creation-date` | | `creation-time` | alias of `creation-date` |
| `date` | alias of `creation-date` | | `date` | alias of `creation-date` |
| `time` | alias of `creation-date` | | `time` | alias of `creation-date` |
| `last-edit-date` | edited at given date | | `file-last-modified-time` | source file last modified at given date, based on file metadata |
| `last-edit-time` | alias of `last-edit-date` | | `file-modified` | alias of `file-last-modified-time` |
| `edit-date` | alias of `last-edit-date` | | `source-modified` | alias of `file-last-modified-time` |
| `edit-time` | alias of `last-edit-date` | | `flmt` | alias of `file-last-modified-time` |
| `comment-date` | commented at given date | | `last-edit-date` | edited at given date |
| `comment-time` | alias of `comment-date` | | `last-edit-time` | alias of `last-edit-date` |
| `fav-date` | last favorited at given date | | `edit-date` | alias of `last-edit-date` |
| `fav-time` | alias of `fav-date` | | `edit-time` | alias of `last-edit-date` |
| `feature-date` | featured at given date | | `comment-date` | commented at given date |
| `feature-time` | alias of `feature-time` | | `comment-time` | alias of `comment-date` |
| `safety` | having given safety. `<value>` can be either `safe`, `sketchy` (or `questionable`) or `unsafe`. | | `fav-date` | last favorited at given date |
| `rating` | alias of `safety` | | `fav-time` | alias of `fav-date` |
| `feature-date` | featured at given date |
| `feature-time` | alias of `feature-time` |
| `safety` | having given safety. `<value>` can be either `safe`, `sketchy` (or `questionable`) or `unsafe`. |
| `rating` | alias of `safety` |
**Sort style tokens** **Sort style tokens**
| `<value>` | Description | | `<value>` | Description |
| ---------------- | ------------------------------------------------ | | ------------------------- | ---------------------------------------------------------- |
| `random` | as random as it can get | | `random` | as random as it can get |
| `id` | highest to lowest post number | | `id` | highest to lowest post number |
| `score` | highest scored | | `score` | highest scored |
| `tag-count` | with most tags | | `tag-count` | with most tags |
| `comment-count` | most commented first | | `comment-count` | most commented first |
| `fav-count` | loved by most | | `fav-count` | loved by most |
| `note-count` | with most annotations | | `note-count` | with most annotations |
| `relation-count` | with most relations | | `relation-count` | with most relations |
| `feature-count` | most often featured | | `feature-count` | most often featured |
| `file-size` | largest files first | | `file-size` | largest files first |
| `image-width` | widest images first | | `image-width` | widest images first |
| `image-height` | tallest images first | | `image-height` | tallest images first |
| `image-area` | largest images first | | `image-area` | largest images first |
| `width` | alias of `image-width` | | `width` | alias of `image-width` |
| `height` | alias of `image-height` | | `height` | alias of `image-height` |
| `area` | alias of `image-area` | | `area` | alias of `image-area` |
| `creation-date` | newest to oldest (pretty much same as id) | | `creation-date` | newest to oldest (pretty much same as id) |
| `creation-time` | alias of `creation-date` | | `creation-time` | alias of `creation-date` |
| `date` | alias of `creation-date` | | `date` | alias of `creation-date` |
| `time` | alias of `creation-date` | | `time` | alias of `creation-date` |
| `last-edit-date` | like creation-date, only looks at last edit time | | `file-last-modified-time` | newest to oldest based on source file's last modified time |
| `last-edit-time` | alias of `last-edit-date` | | `file-modified` | alias of `file-last-modified-time` |
| `edit-date` | alias of `last-edit-date` | | `source-modified` | alias of `file-last-modified-time` |
| `edit-time` | alias of `last-edit-date` | | `flmt` | alias of `file-last-modified-time` |
| `comment-date` | recently commented by anyone | | `last-edit-date` | like creation-date, only looks at last edit time |
| `comment-time` | alias of `comment-date` | | `last-edit-time` | alias of `last-edit-date` |
| `fav-date` | recently added to favorites by anyone | | `edit-date` | alias of `last-edit-date` |
| `fav-time` | alias of `fav-date` | | `edit-time` | alias of `last-edit-date` |
| `feature-date` | recently featured | | `comment-date` | recently commented by anyone |
| `feature-time` | alias of `feature-time` | | `comment-time` | alias of `comment-date` |
| `fav-date` | recently added to favorites by anyone |
| `fav-time` | alias of `fav-date` |
| `feature-date` | recently featured |
| `feature-time` | alias of `feature-time` |
**Special tokens** **Special tokens**
@ -841,13 +868,14 @@ data.
```json5 ```json5
{ {
"tags": [<tag1>, <tag2>, <tag3>], "tags": [<tag1>, <tag2>, <tag3>],
"safety": <safety>, "safety": <safety>,
"source": <source>, // optional "source": <source>, // optional
"relations": [<post1>, <post2>, <post3>], // optional "relations": [<post1>, <post2>, <post3>], // optional
"notes": [<note1>, <note2>, <note3>], // optional "notes": [<note1>, <note2>, <note3>], // optional
"flags": [<flag1>, <flag2>], // optional "flags": [<flag1>, <flag2>], // optional
"anonymous": <anonymous> // optional "anonymous": <anonymous>, // optional
"fileLastModifiedTime": <timestamp> // optional
} }
``` ```
@ -869,17 +897,33 @@ data.
- **Description** - **Description**
Creates a new post. If specified tags do not exist yet, they will be Creates a new post.
automatically created. Tags created automatically have no implications, no
suggestions, one name and their category is set to the first tag category * If specified tags do not exist yet, they will be automatically created.
found. Safety must be any of `"safe"`, `"sketchy"` or `"unsafe"`. Relations Tags created automatically have no implications, no suggestions, one name
must contain valid post IDs. If `<flag>` is omitted, they will be defined and their category is set to the first tag category found.
by default (`"loop"` will be set for all video posts, and `"sound"` will be
auto-detected). Sending empty `thumbnail` will cause the post to use default * Safety must be any of `"safe"`, `"sketchy"` or `"unsafe"`.
thumbnail. If `anonymous` is set to truthy value, the uploader name won't be
* Relations must contain valid post IDs.
* If `<flag>` is omitted, they will be defined by default. (`"loop"` will
be set for all video posts, and `"sound"` will be auto-detected).
* Sending empty `thumbnail` will cause the post to use default thumbnail.
* If `anonymous` is `true`, the uploader name won't be
recorded (privilege verification still applies; it's possible to disallow recorded (privilege verification still applies; it's possible to disallow
anonymous uploads completely from config.) For details on how to pass `content` anonymous uploads completely from config.)
and `thumbnail`, see [file uploads](#file-uploads).
* If `file-last-modified-time` is omitted, the time the post is updated
will be used instead. Its value must be a UNIX timestamp **in
milliseconds**. This parameter is made available to the client to allow for
placing custom times. **Note that this parameter cannot be changed until
the next time the content of the post is updated.**
*For details on how to pass `content` and `thumbnail`, see
[file uploads](#file-uploads).*
## Updating post ## Updating post
- **Request** - **Request**
@ -890,13 +934,14 @@ data.
```json5 ```json5
{ {
"version": <version>, "version": <version>,
"tags": [<tag1>, <tag2>, <tag3>], // optional "tags": [<tag1>, <tag2>, <tag3>], // optional
"safety": <safety>, // optional "safety": <safety>, // optional
"source": <source>, // optional "source": <source>, // optional
"relations": [<post1>, <post2>, <post3>], // optional "relations": [<post1>, <post2>, <post3>], // optional
"notes": [<note1>, <note2>, <note3>], // optional "notes": [<note1>, <note2>, <note3>], // optional
"flags": [<flag1>, <flag2>] // optional "flags": [<flag1>, <flag2>], // optional
"fileLastModifiedTime": <file-last-modified-time> // optional
} }
``` ```
@ -919,16 +964,36 @@ data.
- **Description** - **Description**
Updates existing post. If specified tags do not exist yet, they will be Updates an existing post.
automatically created. Tags created automatically have no implications, no
suggestions, one name and their category is set to the first tag category * If specified tags do not exist yet, they will be automatically created.
found. Safety must be any of `"safe"`, `"sketchy"` or `"unsafe"`. Relations Tags created automatically have no implications, no suggestions, one name
must contain valid post IDs. `<flag>` can be either `"loop"` to enable looping and their category is set to the first tag category found.
for video posts or `"sound"` to indicate sound. Sending empty `thumbnail` will
reset the post thumbnail to default. For details how to pass `content` and * Safety must be any of `"safe"`, `"sketchy"` or `"unsafe"`.
`thumbnail`, see [file uploads](#file-uploads). All fields except the
[`version`](#versioning) are optional - update concerns only provided * Relations must contain valid post IDs.
fields.
* If `<flag>` is omitted, they will be defined by default. (`"loop"` will
be set for all video posts, and `"sound"` will be auto-detected).
* Sending empty `thumbnail` will cause the post to use default thumbnail.
* If `anonymous` is `true`, the uploader name won't be
recorded (privilege verification still applies; it's possible to disallow
anonymous uploads completely from config.)
* If `file-last-modified-time` is omitted, the time the post is created
will be used instead. Its value must be a UNIX timestamp **in
milliseconds**. This parameter is made available to the client to allow for
placing custom times. **Note that this parameter cannot be changed until
the next time the content of the post is updated.**
* All fields except the [`version`](#versioning) are optional - update
concerns only provided fields.
*For details on how to pass `content` and `thumbnail`, see
[file uploads](#file-uploads).*
## Getting post ## Getting post
- **Request** - **Request**
@ -1008,11 +1073,13 @@ data.
- **Description** - **Description**
Removes source post and merges all of its tags, relations, scores, Removes source post and merges all of its tags, relations, scores,
favorites and comments to the target post. If `replaceContent` is set to favorites and comments to the target post.
true, content of the target post is replaced using the content of the
source post; otherwise it remains unchanged. Source post properties such as * If `replaceContent` is set to true, content of the target post is
its safety, source, whether to loop the video and other scalar values do replaced using the content of the *source post*; otherwise it remains
not get transferred and are discarded. unchanged. Source post properties such as its safety, source, whether to
loop the video and other scalar values do not get transferred and are
discarded.
## Rating post ## Rating post
- **Request** - **Request**
@ -1094,9 +1161,11 @@ data.
- **Description** - **Description**
Retrieves the post that is currently featured on the main page in web Retrieves the post that is currently featured on the main page in web
client. If no post is featured, `<post>` is null. Note that this method client.
exists mostly for compatibility with setting featured post - most of times,
you'd want to use query global info which contains more information. * If no post is featured, `<post>` is null. Note that this method
exists mostly for compatibility with setting featured post - most of the
time, you'd want to query global info which contains more information.
## Featuring post ## Featuring post
- **Request** - **Request**
@ -1190,9 +1259,11 @@ data.
- **Description** - **Description**
Creates a new pool category using specified parameters. Name must match Creates a new pool category using specified parameters.
`pool_category_name_regex` from server's configuration. First category
created becomes the default category. * Name must match `pool_category_name_regex` from server's configuration.
* First category created becomes the default category.
## Updating pool category ## Updating pool category
- **Request** - **Request**
@ -1224,10 +1295,12 @@ data.
- **Description** - **Description**
Updates an existing pool category using specified parameters. Name must Updates an existing pool category using specified parameters.
match `pool_category_name_regex` from server's configuration. All fields
except the [`version`](#versioning) are optional - update concerns only * Name must match `pool_category_name_regex` from server's configuration.
provided fields.
* All fields except the [`version`](#versioning) are optional - update
concerns only provided fields.
## Getting pool category ## Getting pool category
- **Request** - **Request**
@ -1390,12 +1463,16 @@ data.
- **Description** - **Description**
Creates a new pool using specified parameters. Names, suggestions and Creates a new pool using specified parameters.
implications must match `pool_name_regex` from server's configuration.
Category must exist and is the same as `name` field within * Names, suggestions and implications must match `pool_name_regex` from
[`<pool-category>` resource](#pool-category). `posts` is an optional list of server's configuration.
integer post IDs. If the specified posts do not exist, an error will be
thrown. * Category must exist and is the same as `name` field within
[`<pool-category>` resource](#pool-category).
* `posts` is an optional list of integer post IDs. If the specified posts
do not exist, an error will be thrown.
## Updating pool ## Updating pool
- **Request** - **Request**
@ -1431,14 +1508,20 @@ data.
- **Description** - **Description**
Updates an existing pool using specified parameters. Names, suggestions and Updates an existing pool using specified parameters.
implications must match `pool_name_regex` from server's configuration.
Category must exist and is the same as `name` field within * Names, suggestions and implications must match `pool_name_regex` from
[`<pool-category>` resource](#pool-category). `posts` is an optional list of server's configuration.
integer post IDs. If the specified posts do not exist yet, an error will be
thrown. The full list of post IDs must be provided if they are being * Category must exist and is the same as `name` field within
updated, and the previous list of posts will be replaced with the new one. [`<pool-category>` resource](#pool-category).
All fields except the [`version`](#versioning) are optional - update
* `posts` is an optional list of integer post IDs. If the specified posts
do not exist yet, an error will be thrown. The full list of post IDs must
be provided if they are being updated, and the previous list of posts will
be replaced with the new one.
* All fields except the [`version`](#versioning) are optional - update
concerns only provided fields. concerns only provided fields.
## Getting pool ## Getting pool
@ -1798,12 +1881,16 @@ data.
- **Description** - **Description**
Creates a new user using specified parameters. Names and passwords must Creates a new user using specified parameters.
match `user_name_regex` and `password_regex` from server's configuration,
respectively. Email address, rank and avatar fields are optional. Avatar * Names and passwords must match `user_name_regex` and `password_regex`
style can be either `gravatar` or `manual`. `manual` avatar style requires from server's configuration, respectively.
client to pass also `avatar` file - see [file uploads](#file-uploads) for
details. If the rank is empty and the user happens to be the first user * Email address, rank and avatar fields are optional. Avatar style can be
either `gravatar` or `manual`. `manual` avatar style also requires client
to pass `avatar` file - see [file uploads](#file-uploads) for details.
* If the rank is empty and the user happens to be the first user
ever created, become an administrator, whereas subsequent users will be ever created, become an administrator, whereas subsequent users will be
given the rank indicated by `default_rank` in the server's configuration. given the rank indicated by `default_rank` in the server's configuration.
@ -1846,15 +1933,19 @@ data.
- **Description** - **Description**
Updates an existing user using specified parameters. Names and passwords Updates an existing user using specified parameters.
must match `user_name_regex` and `password_regex` from server's
configuration, respectively. All fields are optional - update concerns only * All fields except the [`version`](#versioning) are optional - update
provided fields. To update last login time, see concerns only provided fields.
[authentication](#authentication). Avatar style can be either `gravatar` or
`manual`. `manual` avatar style requires client to pass also `avatar` * Names and passwords must match `user_name_regex` and `password_regex`
file - see [file uploads](#file-uploads) for details. All fields except the from server's configuration, respectively.
[`version`](#versioning) are optional - update concerns only provided
fields. * To update last login time, see [authentication](#authentication).
* Avatar style can be either `gravatar` or `manual`. `manual` avatar style
also requires client to pass `avatar` file - see
[file uploads](#file-uploads) for details.
## Getting user ## Getting user
- **Request** - **Request**
@ -2027,11 +2118,12 @@ data.
- **Description** - **Description**
Sends a confirmation email to given user. The email contains link Sends a confirmation email to given user.
containing a token. The token cannot be guessed, thus using such link
proves that the person who requested to reset the password also owns the * The email contains link containing a token. The token cannot be guessed,
mailbox, which is a strong indication they are the rightful owner of the thus using such link proves that the person who requested to reset the
account. password also owns the mailbox, which is a strong indication they are the
rightful owner of the account.
## Password reset - step 2: confirmation ## Password reset - step 2: confirmation
- **Request** - **Request**
@ -2134,12 +2226,16 @@ data.
- **Description** - **Description**
Retrieves simple statistics. `<featured-post>` is null if there is no Retrieves simple statistics.
featured post yet. `<server-time>` is pretty much the same as the `Date`
HTTP field, only formatted in a manner consistent with other dates. Values * `<featured-post>` is null if there is no featured post yet.
in `config` key are taken directly from the server config, with the
exception of privilege array keys being converted to lower camel case to * `<server-time>` is pretty much the same as the `Date` HTTP field, only
match the API convention. formatted in a manner consistent with other dates.
* Values in `config` key are taken directly from the server config, with
the exception of privilege array keys being converted to lower camel case
to match the API convention.
## Uploading temporary file ## Uploading temporary file
@ -2353,36 +2449,37 @@ One file together with its metadata posted to the site.
```json5 ```json5
{ {
"version": <version>, "version": <version>,
"id": <id>, "id": <id>,
"creationTime": <creation-time>, "creationTime": <creation-time>,
"lastEditTime": <last-edit-time>, "fileLastModifiedTime": <file-last-modified-time>,
"safety": <safety>, "lastEditTime": <last-edit-time>,
"source": <source>, "safety": <safety>,
"type": <type>, "source": <source>,
"checksum": <checksum>, "type": <type>,
"canvasWidth": <canvas-width>, "checksum": <checksum>,
"canvasHeight": <canvas-height>, "canvasWidth": <canvas-width>,
"contentUrl": <content-url>, "canvasHeight": <canvas-height>,
"thumbnailUrl": <thumbnail-url>, "contentUrl": <content-url>,
"flags": <flags>, "thumbnailUrl": <thumbnail-url>,
"tags": <tags>, "flags": <flags>,
"relations": <relations>, "tags": <tags>,
"notes": <notes>, "relations": <relations>,
"user": <user>, "notes": <notes>,
"score": <score>, "user": <user>,
"ownScore": <own-score>, "score": <score>,
"ownFavorite": <own-favorite>, "ownScore": <own-score>,
"tagCount": <tag-count>, "ownFavorite": <own-favorite>,
"favoriteCount": <favorite-count>, "tagCount": <tag-count>,
"commentCount": <comment-count>, "favoriteCount": <favorite-count>,
"noteCount": <note-count>, "commentCount": <comment-count>,
"featureCount": <feature-count>, "noteCount": <note-count>,
"relationCount": <relation-count>, "featureCount": <feature-count>,
"lastFeatureTime": <last-feature-time>, "relationCount": <relation-count>,
"favoritedBy": <favorited-by>, "lastFeatureTime": <last-feature-time>,
"hasCustomThumbnail": <has-custom-thumbnail>, "favoritedBy": <favorited-by>,
"mimeType": <mime-type>, "hasCustomThumbnail": <has-custom-thumbnail>,
"mimeType": <mime-type>,
"comments": [ "comments": [
<comment>, <comment>,
<comment>, <comment>,
@ -2396,6 +2493,10 @@ One file together with its metadata posted to the site.
- `<version>`: resource version. See [versioning](#versioning). - `<version>`: resource version. See [versioning](#versioning).
- `<id>`: the post identifier. - `<id>`: the post identifier.
- `<creation-time>`: time the tag was created, formatted as per RFC 3339. - `<creation-time>`: time the tag was created, formatted as per RFC 3339.
- `<file-last-modified-time>`: in uploading, this is a UNIX timestamp in
milliseconds. After the post has been created, this represents the last time
the source file was modified based on file metadata, formatted as per RFC
3339.
- `<last-edit-time>`: time the tag was edited, formatted as per RFC 3339. - `<last-edit-time>`: time the tag was edited, formatted as per RFC 3339.
- `<safety>`: whether the post is safe for work. - `<safety>`: whether the post is safe for work.