OpenIsle Docs
API 概览
List posts GET Create post POST
List comments GET Create comment POST
Api
Posts
Postid
Comments

# Create comment

Add a comment to a post

POST
/`api`/`posts`/`{postId}`/`comments`

## Authorization

AuthorizationBearer <token>

In: `header`

## Path Parameters

postIdinteger
Format `int64`

## Request Body

content?string
captcha?string

## Response Body

###

    curl -X POST "https://www.open-isle.com/api/posts/0/comments" \  -H "Content-Type: application/json" \  -d '{}'

    {
      "id": 0,
      "content": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "pinnedAt": "2019-08-24T14:15:22Z",
      "author": {
        "id": 0,
        "username": "string",
        "avatar": "string",
        "displayMedal": "COMMENT"
      },
      "replies": [
        {
          "id": 0,
          "content": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "pinnedAt": "2019-08-24T14:15:22Z",
          "author": {
            "id": 0,
            "username": "string",
            "avatar": "string",
            "displayMedal": "COMMENT"
          },
          "replies": [],
          "reactions": [
            {
              "id": 0,
              "type": "LIKE",
              "user": "string",
              "postId": 0,
              "commentId": 0,
              "messageId": 0,
              "reward": 0
            }
          ],
          "reward": 0,
          "pointReward": 0
        }
      ],
      "reactions": [
        {
          "id": 0,
          "type": "LIKE",
          "user": "string",
          "postId": 0,
          "commentId": 0,
          "messageId": 0,
          "reward": 0
        }
      ],
      "reward": 0,
      "pointReward": 0
    }

List comments GET

Previous Page

React to post POST

Next Page

    curl -X POST "https://www.open-isle.com/api/posts/0/comments" \
      -H "Content-Type: application/json" \
      -d '{}'