Get the document list interface

API call address

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

illustrate:{域名地址}You need to replace it with your domain address, such as/api/archive/list

Calling methods

GET

Request parameters

Field name type Required illustrate
id int no Document ID, when you want to get type=related, you need to specify
moduleId int no Model ID
excludeCategoryId int no Excluded document classification ID, multiple classification IDs are available, separated
categoryId int no Document classification ID, multiple classification IDs are available, separated
Order string no Sort by:id desc, supported fields are:id,views,category_id,created_time,updated_timewait
type int no Support buttonpage,list,relatedList method. The default value islist, when type="list", only the specified limit specified number will be displayed. If type="page" is used, the number of documents can be obtained.
flag string no Recommended attributesflagSupported attribute values ​​include headlines [h], recommended [c], slideshow [f], special recommendation [a], scroll [s], bold [h], picture [p], and jump [j]. If you want to show that the flag attribute is recommended, the tag is flag="c"
child boolean no Whether to display all subcategories documents, the supported attribute values ​​are false|true, and the default is true. If you want to display only documents belonging to the current category and do not include documents that are subcategorized, you need to specify child=false
page int no Specify which page content to get, only effective when type="page"
limit int no To display quantity, limit can specify the display quantity and paging according to the number. For example, limit="10" will only display 10 pieces. When limit is not a paging list, it supports offset mode, that is, separating mode. If you want to obtain 10 pieces of data from item 2, you can set it to limit="2,10".
q string no Search for keywords, q only takes effect when the list type="page" is type="page". You can specify the search content. If you need to search for content, you can use the parameter q to display the title that contains keywords. The rendering result will only display the list of the title containing the SEO keywords. It can also be not specified. If the query parameter of q= keyword exists in the url, the content of the q keyword will be automatically read in the paging list and used for search.
Custom filter parameters string no The filtering parameters only take effect when the list type="page" is type="page". For example, in the additional automatic configuration of the document, filterable fields are configured. These parameters can be used to complete the parameter filtering of the document. If your document has set filtering automatically as gender, and the default values ​​are male, female, confidential, you can search for the document content of the gender field that is male through the query parameter gender=male.

Return parameters

Field name type illustrate
code int Error code
msg string Error Cause Description
data object[] Results content
Total int The number of documents will be returned only if type=page

data result item parameter

Field name type illustrate
id int Document ID
title string Document title
seo_title string Document SEO title
url_token string Document URL alias
keywords string Document keywords
Description string Document Introduction
module_id int Document model ID
category_id int Document Classification ID
views int Document view count
comment_count int Document comments
images string[] Document group photo
logo string Document Logo
thumb string Document thumbnails
flag string Document recommendation attributes, headlines[h]recommended[c]slide[f]special recommendation[a]scroll[s]bold[h]pics[p]jump[j]
canonical_url string canonical url
fixed_link string Document Permalink
created_time int Document release timestamp
updated_time int Document update timestamp
status int Document display status
user_id int User ID
price int Price, unit points
stock int Inventory quantity
user_id int User ID
extra object Other fields information of the document
Extra document other field information

extra fields are displayed according to the model set, and the field structure is key => item:
key form field call name, item is the content:

Field name type illustrate
name string Field name
value string The value filled in
default string default value

Request data example

parameter value
moduleId 1
type page

Return to the data example

{
    "code": 0,
    "data": [
        {
            "id": 1,
            "created_time": 1607308159,
            "updated_time": 1662717106,
            "title": "关于AnqiCMS",
            "seo_title": "",
            "url_token": "design",
            "keywords": "",
            "description": "安企内容管理系统(AnqiCMS),是一款使用 GoLang 开发的企业站内容管理系统,它部署简单,软件安全,界面优雅,小巧,执行速度飞快,使用 AnqiCMS 搭建的网站可以防止众多安全问题发生。",
            "module_id": 1,
            "category_id": 1,
            "views": 1338,
            "comment_count": 0,
            "images": null,
            "template": "",
            "status": 1,
            "canonical_url": "",
            "fixed_link": "",
            "flag": "",
            "user_id": 0,
            "price": 0,
            "stock": 9999999,
            "has_pseudo": 0,
            "keyword_id": 0,
            "origin_url": "",
            "origin_title": "",
            "category": null,
            "module_name": "",
            "data": null,
            "logo": "https://en.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
            "thumb": "https://en.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
            "extra": {
                "author": {
                    "name": "作者",
                    "value": "AnqiCMS",
                    "default": null
                },
                "certificate": {
                    "name": "学历",
                    "value": null,
                    "default": null
                },
                "city": {
                    "name": "城市",
                    "value": null,
                    "default": null
                }
            },
            "link": "/design"
        },
        {
            "id": 2,
            "created_time": 1607308247,
            "updated_time": 1611373941,
            "title": "AnqiCMS使用帮助",
            "seo_title": "",
            "url_token": "help",
            "keywords": "",
            "description": "anqicms常见问题汇总",
            "module_id": 1,
            "category_id": 1,
            "views": 1655,
            "comment_count": 0,
            "images": null,
            "template": "",
            "status": 1,
            "canonical_url": "",
            "fixed_link": "",
            "flag": "",
            "user_id": 0,
            "price": 0,
            "stock": 9999999,
            "has_pseudo": 0,
            "keyword_id": 0,
            "origin_url": "",
            "origin_title": "",
            "category": null,
            "module_name": "",
            "data": null,
            "logo": "https://en.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
            "thumb": "https://en.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
            "extra": null,
            "link": "/help"
        },
    ],
    "msg": "",
    "total": 2
}

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