Document publishing interface

API call address

{域名地址}/api/archive/publish

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

Calling methods

POST application/json

Request parameters

Field name type Required illustrate
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, within 250 characters
url_token string no Custom URL Alias, only supports numbers and letters
images string[] no Article group images, 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 release time of the document can be the future time. If it is the future time, the document will not be officially released until the time has come.
tags string[] no Document Tag label, array
Other custom fields any no If you have passed other custom fields, and the field exists in the document model, it is also supported.
price int no Price, unit, integer
stock int no in stock
read_level int no Reading Level

Return parameters

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

Data Result

Field name type illustrate
id int Document ID
link string Document link
user_id int User ID
status int Review status, 1 Approved, 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 to the data example

{
  "code": 0,
  "data": {
    "id": 33,
    "link": "https://en.anqicms.com/article/33.html",
    "status": 0
  },
  "msg": "发布成功"
}

Error code

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