Comments
The replies under a post and under a profile.
In the database they are two tables, an accident of the order they
were built in. Here they are one resource: on says what the reply
sits under, and a reply's id is enough to change or remove it,
because both tables take their ids from the same generator.
The author decides who may reply, and the refusal is 403 forbidden
with the reason in the message.
A removed reply does not leave the list: it stays in its place with an
empty body and deleted_at set, because a conversation is a tree and
the replies to it would otherwise come back as roots.
removed_by_staff says whether moderation removed it, rather than its
author or the owner of what it sits under.
contains_spoilers says the reply gives something away: ask before
showing it. There are two marks, and either is enough: the author's,
set when replying or rewriting (author_spoilers), and moderation's
(staff_spoilers), which the author cannot undo. A rewrite that does
not send contains_spoilers leaves the author's mark as it is.
/api/ v1/ commentsThe replies on something, oldest first, with each one's author and its like count. A removed reply stays in its place, with an empty body and deleted_at set, so the replies to it keep their thread; removed_by_staff says whether moderation removed it, rather than its author or the owner of what it sits under. contains_spoilers says the reply gives something away, to ask before showing it: it is true when its author or moderation marked it as a spoiler. The two marks also come apart, author_spoilers the author's and staff_spoilers moderation's, which the author cannot undo.
Query
| Field | Type | Notes |
|---|---|---|
onrequired | string | review, list, screenshot, diary, award or profile. |
idrequired | string | The content's id. With on=profile it is the username, because that is the only name a profile has here. |
/api/ v1/ commentsReply. The author decides who may: a closed space answers 403 forbidden and the message says so.
Body
| Field | Type | Notes |
|---|---|---|
onrequired | string | The same as the GET's. |
idrequired | string | The same as the GET's. |
bodyrequired | string | Up to 2000 characters. |
parent_id | string | The reply this one answers. A conversation has a depth limit, and going past it is a 400. |
contains_spoilers | boolean | true when the reply gives something away, so readers are asked before it opens. It is the author's own mark; false by default. |
/api/ v1/ comments/ {id}Rewrite one of your replies. The id is enough: both tables take their ids from the same generator, so there is no need to say which one it belongs to.
Body
| Field | Type | Notes |
|---|---|---|
bodyrequired | string | Up to 2000 characters. |
contains_spoilers | boolean | The author's spoiler mark. Without it, or with null, the mark stays as it is. false removes only the author's: a reply moderation marked keeps contains_spoilers true. |
/api/ v1/ comments/ {id}Remove one of your replies, or a reply under something of yours.