Skip to content

Comment API โ€‹

List Comments By Post โ€‹

prolog
GET API_BASE/comments?post_id=:post_id&offset=:offset&limit=:limit

Parameters โ€‹

ParameterTypeDescription
post_iduint64The post ID.
offsetnumberPagination offset.
limitnumberPagination limit.

Response โ€‹

json
{
  "data": {
    "pagination": {
      "total": 0,
      "offset": 0,
      "next_offset": 20,
      "limit": 20
    },
    "items": [CommentObject, ...]
  },
  "ts": 1723923923
}

Create Comment โ€‹

prolog
POST API_BASE/comments

Authorization Required โ€‹

OAuthAPIKey
YesYes

Request Body โ€‹

json
{
  "post_id": 1,
  "quote_comment_id": 0,
  "content": "..."
}

Response โ€‹

json
{
  "data": CommentObject,
  "ts": 1723923923
}

Approve Comment โ€‹

prolog
PUT API_BASE/comments/:comment_id/approve

Authorization Required โ€‹

OAuthAPIKey
YesYes

Only the post owner can approve or reject comments.

Response โ€‹

json
{
  "data": null,
  "ts": 1723923923
}

Reject Comment โ€‹

prolog
PUT API_BASE/comments/:comment_id/reject

Authorization Required โ€‹

OAuthAPIKey
YesYes

Response โ€‹

json
{
  "data": null,
  "ts": 1723923923
}

Mark Comment as Spam โ€‹

prolog
PUT API_BASE/comments/:comment_id/spam

Authorization Required โ€‹

OAuthAPIKey
YesYes

Response โ€‹

json
{
  "data": null,
  "ts": 1723923923
}

Delete Comment โ€‹

prolog
DELETE API_BASE/comments/:comment_id

Authorization Required โ€‹

OAuthAPIKey
YesYes

Authors and post owners can delete comments.

Response โ€‹

json
{
  "data": null,
  "ts": 1723923923
}