Get comment list interface

API call address

{域名地址}/api/comment/list

illustrate:{域名地址}You need to replace it with your domain address, such ashttps://en.anqicms.com/api/comment/list

Calling methods

GET

Request parameters

Field name type Required illustrate
id int no Document ID, the specified document ID
Order string no Comments sort, defaultid desc
page int no Get the specified page content, default: 1
limit int no Display quantity, 'limit' can specify the display quantity, and it pages by how many quantities, for example, if 'limit' is set to '10', only 10 items will be displayed. When 'limit' is not used in a pagination list, it supports the 'offset' mode, which is also known as comma-separated mode. If you want to start from the second item and retrieve 10 items, it can be set to 'limit'='2,10'.

Return parameters

Field name type illustrate
code int Error code
msg string Error Cause Description
data object[] Results content

data result item parameter

Field name type illustrate
id int Comment ID
parent_id int Parent ID of the comment
archive_id int Document ID
user_name string Comment username
user_id int Commenter user ID
ip string IP of the commenter
vote_count int Number of likes
content string Category content details
created_time int Post timestamp
updated_time int Update time stamp
status int Review status, 1 Approved, 0 Reviewing

Request data example

parameter value
moduleId 1
parentId 0

Return to the data example

{
  "code": 0,
  "data": [
    {
      "id": 1,
      "created_time": 1624494644,
      "updated_time": 1626076192,
      "archive_id": 71,
      "user_id": 0,
      "user_name": "crown",
      "ip": "127.0.0.1",
      "vote_count": 0,
      "content": "欢迎使用AnqiCMS",
      "parent_id": 0,
      "to_uid": 0,
      "status": 1,
      "item_title": "",
      "parent": null,
      "active": false
    },
    {
      "id": 2,
      "created_time": 1624070973,
      "updated_time": 1635423845,
      "archive_id": 71,
      "user_id": 0,
      "user_name": "Memory",
      "ip": "127.0.0.1",
      "vote_count": 225,
      "content": "博客系统很棒",
      "parent_id": 1,
      "to_uid": 0,
      "status": 1,
      "item_title": "",
      "parent": null,
      "active": false
    }
  ],
  "msg": "",
  "total": 4
}

Error code

Error code illustrate
0 OK
-1 Error, the error reason is indicated in msg
1001 Not logged in
1002 Unauthorized
200 API Request OK