API Call Address
{域名地址}/api/comment/list
Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/comment/list
Calling method
GET
Request parameters
| Field name |
Type |
Required |
Description |
| id |
int |
No |
Document ID, specified document ID |
| order |
string |
No |
Comment sorting, defaultid desc |
| page |
int |
No |
Get specified page content, default: 1 |
| limit |
int |
No |
Display quantity, 'limit' can specify the display quantity, paginated by how many items, for example, 'limit="10"' will only display 10 items. When 'limit' is not used in a pagination list, it supports the 'offset' mode, which is the comma-separated mode. If you want to start from the second item and get 10 items, you can set it to 'limit="2,10"'. |
Return parameters
| Field name |
Type |
Description |
| code |
int |
error code |
| msg |
string |
error reason description |
| data |
object[] |
result content |
data result item parameters
| Field name |
Type |
Description |
| 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 |
Comment User ID |
| IP |
string |
Commenter IP |
| Vote Count |
int |
Like count |
| content |
string |
Category content details |
| Created Time |
int |
Publish timestamp |
| updated_time |
int |
update timestamp |
| status |
int |
Review status, 1 Reviewed, 0 Reviewing |
request data example
| Parameter |
Value |
| moduleId |
1 |
| parentId |
0 |
Return 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 |
Description |
| 0 |
OK |
| -1 |
Error, the reason is indicated in the msg |
| 1001 |
Not logged in |
| 1002 |
Unauthorized |
| 200 |
API request OK |