API Call Address
{域名地址}/api/comment/publish
Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/comment/publish
Calling method
POST application/json
Request parameters
| Field name |
Type |
Required |
Description |
| archive_id |
int |
Yes |
Document ID of the comment |
| user_name |
string |
Yes |
Username |
| content |
string |
Yes |
Comment content |
| parent_id |
int |
No |
ID of the referenced comment |
Return parameters
| Field name |
Type |
Description |
| code |
int |
error code |
| msg |
string |
error reason description |
| data |
object |
result content |
data Result
| 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
{
"user_name": "anqicms",
"content": "欢迎使用anqicms",
"archive_id": 140
}
Return Data Example
{
"code": 0,
"data": {
"id": 33,
"created_time": 1662734920,
"updated_time": 1662734920,
"archive_id": 140,
"user_id": 0,
"user_name": "anqicms",
"ip": "127.0.0.1",
"vote_count": 0,
"content": "欢迎使用anqicms",
"parent_id": 0,
"status": 0
},
"msg": "发布成功"
}
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 |