API Call Address
{域名地址}/api/archive/publish
Description:{域名地址}
Need to replace it with your domain address, such ashttps://en.anqicms.com/api/archive/publish
Calling method
POST application/json
Request parameters
Field name |
Type |
Required |
Description |
title |
string |
Yes |
Document Title |
content |
string |
Yes |
document content |
category_id |
int |
Yes |
Document Category ID |
Keywords |
string |
No |
Document Keywords |
Description |
string |
No |
document summary, 250 words or less |
url_token |
string |
No |
custom URL alias, supports numbers and letters only |
images |
string[] |
No |
Article group photo, array, up to 9 images can be set. Repeat this field for multiple images. The first one is the logo |
Created Time |
int |
No |
Format: Timestamp. The publication time of the document, which can be in the future. If it is in the future, the document will be officially published when the time comes. |
tags |
string[] |
No |
Document Tag, array |
Other custom fields |
any |
No |
If you also passed other custom fields, and the field exists in the document model, it is also supported. |
price |
int |
No |
Price, unit in cents, integer |
stock |
int |
No |
Inventory |
read_level |
int |
No |
Reading level |
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 |
Document ID |
link |
string |
Document Link |
user_id |
int |
User ID |
status |
int |
Review status, 1 Reviewed, 0 Reviewing |
request data example
{
"title": "欢迎使用anqicms",
"content": "<p>欢迎使用anqicms</p>",
"category_id": 2,
"images": [
"https://en.anqicms.com/uploads/arc1.png",
"https://en.anqicms.com/uploads/arc2.png"
],
"tags": ["安企CMS", "anqicms"],
"quality": "高清"
}
Return Data Example
{
"code": 0,
"data": {
"id": 33,
"link": "https://en.anqicms.com/article/33.html",
"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 |