acyka api

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 #

fieldtypewhat it is
id PostIdA string for the reason [`Me::id`] is one.
body string
shikimori_id may be absentnumber | undefined
title may be absentstring | undefined
episode may be absentnumber | undefined
parent may be absentPostId | undefined
at string

PostBody #

fieldtypewhat it is
body string
shikimori_id may be absentnumber | undefined
title may be absentstring | undefined
episode may be absentnumber | undefined
spoiler may be absentboolean | undefinedRead 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 absentPostId | 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.