Like a post
POST /posts/{id}/like
Likes the post for you. Liking a post you’ve already liked doesn’t
add a second like: the request still succeeds and the post’s
like_count doesn’t go up again.
You need to be signed in and hold posts.like (part of the Base
role) or system.admin; without either you get 403, before the post
is looked at. You then need to be able to read the post: it’s the
same read check GET /posts/{id} makes, without the mature
settings, and a post you can’t read answers 404, as one that doesn’t
exist or is deleted does.
Each successful request also records a like activity. Once it’s saved, the server tries to give the post’s author an in-app notice; none is created if they liked their own post, if one of you has blocked the other, if their notice settings for likes leave out in-app notices, or if creating it fails, which is only logged. A repeat like records another activity and tries again to notify the author. Notices aren’t emailed. Passing the activity on to paired instances is a separate, later step and isn’t part of this request. The post’s cached details are refreshed afterwards on a best-effort basis, so another read can briefly show the old count.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The post’s id.
Responses
Section titled “ Responses ”The post is liked, whether or not it already was.
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completedResource not found
object
Human-readable error summary
Example
the request could not be completed