POST /api/v1/posts
writePost
needs social:write
curl https://api.acyka.cc/api/v1/posts \
-X POST \
-H "Authorization: Bearer $ACYKA_TOKEN" \
-H "Content-Type: application/json" \
-d '{ }' Asking #
The body
PostBody, sent as JSON. Every field it has is under the shapes below.
Answering #
201 Post
The shapes #
Post #
| field | type | what it is |
|---|---|---|
id | PostId | A string for the reason [`Me::id`] is one. |
body | string | |
shikimori_id may be absent | number | undefined | |
title may be absent | string | undefined | |
episode may be absent | number | undefined | |
parent may be absent | PostId | undefined | |
at | string |
PostBody #
| field | type | what it is |
|---|---|---|
body | string | |
shikimori_id may be absent | number | undefined | |
title may be absent | string | undefined | |
episode may be absent | number | undefined | |
spoiler may be absent | boolean | undefined | Read and ignored. A post used to be able to hide behind one flag; `||a phrase||` in the body does that properly and this door is a contract somebody else's code already sends. Refusing the field would break a client over a word that no longer means anything, so it is accepted and dropped. |
parent may be absent | PostId | undefined |
When it says no #
A refusal is { "message": "errors.something" } — a phrase name and never a
sentence, because one screen can be read in five languages. Every library turns the name into a
type, so you catch the class you can do something about. Errors has
the list.