Import document interface

API call address

{域名地址}/api/import/archive?token={token}

illustrate:{域名地址}Need to replace it with your domain address.{token}Need to be replaced with the token in the background content import interface function, such as/api/import/archive?token=xxx

Calling methods

POST form-data

Request parameters

GET parameters

Field name type Required illustrate
token string yes Token in the background content import interface function

POST parameters

Field name type Required illustrate
id int no Document ID, automatically generated by default
title string yes Document title
content string yes Document content
category_id int yes Document Classification ID
keywords string no Document keywords
Description string no Document introduction, less than 250 words
url_token string no Custom URL alias, only support numbers and English letters
logo string no The thumbnail of the document can be an absolute address, such as:/logo.pngOr relative address, such as: /logo.png
images[] string no For article pictures, you can set up to 9 pictures. Please repeat this field for multiple pictures.
publish_time string no Format: 2006-01-02 15:04:05 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.
tag string no Document tags, multiple tags are separated by English commas, for example: aaa, bbb, ccc
Other custom fields any no If you have passed other custom fields, and the field exists in the document model, it is also supported.
draft boolean no Whether to save it in the draft, the supported values ​​are: false
cover boolean no Whether to overwrite when the same title and ID document exist, the supported values ​​are: false

Return parameters

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

Data parameters

Field name type illustrate
id int Document ID
url string Document URL

Request data example

GET parameters

token=4712a54b4c456bb29b7816d241db69a7

POST parameters

parameter value
title Welcome to AnqiCMS
content <p>欢迎使用AnqiCMS</p>
category_id 2
images[] /static/default/images/logo.png

Return to the data example

{
    "code": 0,
    "data": {
        "id": 1,
        "url": "/anqicms"
    },
    "msg": "发布成功"
}

Error code

Error code illustrate
0 OK
-1 Error, the cause of the error is pointed out in msg
1001 Not logged in
1002 Unauthorized
200 API request OK