to get the document list interface

Retrieve the document list with specified conditions in the system, supporting various filtering and sorting methods, and can obtain the document list under specified models, categories, recommended attributes, and other conditions.This interface is applicable to content of document and product types.

Points to note

  • The interface supports various types of data retrieval (page, list, related), the effects of different parameters may vary
  • When type="page", it supports pagination and search features
  • Supports custom filter parameters, which can be filtered according to the fields configured in the model
  • Some fields like price, inventory, etc. are only valid in the product type document.
  • The 'total' field is only returned when type=page.

Request address

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

Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/archive/list

Request Syntax

GET {域名地址}/api/archive/list?{参数}

Request Headers

This interface involves only public request headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Request parameters

Field name Type Required Description
id int No Document ID, when retrieving type=related, it needs to be specified
moduleId int No Model ID
parentId int No Parent document ID
categoryId string No Document category ID, multiple category IDs can be used, separated by commas
excludeCategoryId string No Exclude document category ID, multiple category IDs can be used, separated by commas
order string No Sorting method, such as:id desc, supported fields include:id/views/category_id/created_time/updated_timeetc
type int No Support sorting by:page/list/relatedList in a manner. The default value islistWhen type="list" is specified, only the specified limit of items will be displayed, and if type="page" is specified, the total number of documents can be obtained
flag string No Recommended attributeflagSupported attribute values include Headline[h], Recommended[c], Slideshow[f], Featured[a], Scrolling[s], Bold[h], Image[p], Link[j]. To display the flag attribute as recommended, the tag is flag=“c”
showFlag boolean No Whether to display the recommended attribute, supported values are false|true, default false
showContent boolean No Whether to display the document content, supported attribute values are false|true, default false
showExtra boolean No Whether to display the additional content of the document, supported property values are false|true, default false
showOptions boolean No Whether to display the specification attribute options of the document, supported attribute values are false|true, default false
showSkus boolean No Whether to display the specifications list of the document, supported values are false|true, default false
showWholesaleRules boolean No Whether to display the wholesale rule, supported attribute values are false|true, default false
showCategory boolean No Whether to display document classification, supported attribute values are false|true, default true
child boolean No Whether to display all subcategory documents, supported attribute values are false|true, the default is true. If you only want to display documents belonging to the current category and not including subcategory documents, you need to specify child=false
page int No Specify the page content to be obtained, only effective when type=“page”
limit int No Display the number, 'limit' can specify the number of items to display, pagination by how many items, for example, if 'limit="10
q string No Search keywords, you can specify the search content. If you need to search for content, you can use the parameter q to display the search content with the specified keywords in the title, such as q=“seo”. The results will only display the list of titles containing the keyword seo.Also not specified, if the query parameter q=keyword exists in the url, the q keyword content will be automatically read and used for searching in the pagination list.
Custom Filter Parameter string No Filter parameters, such as in the additional automatic configuration of the document, if there are fields that can be filtered, these parameters can be used to complete parameter filtering of the document.If your document is set to automatically filter by gender, the default values are male, female, and confidential, then you can search for documents where the gender field is male by using the URL query parameter gender=男.

Response header

This interface only involves common response headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Return parameters

Field name Type Description
code int Error code
msg string Error description
data array[object] result content
Total int The number of documents, returned only when type=page

data result item parameter

Field name Type Description
id int Document ID
is_wholesale bool Is it a wholesale product
Wholesale rules object[] List of wholesale rules
Skus object[] Sku list
options object[] specification options information
is_favorite bool whether to collect
brand string Product Brand
Video URL string Video address
Need Logistics bool Whether need logistics
Is Free Shipping bool Is Delivery Free
sold_count int sold count
review count int Number of reviews
favorite count int Number of favorites
option type int Specification type, 0 No SKU, 1 Composite SKU, 2 Markup SKU
weight int weight
weight unit string Weight unit
allow oversold bool Are there overselling allowed
has_order_fields bool Do you have order fields extended
order_fields object[] Order extension fields
Title string Document title
seo title string Document SEO Title
URL Token string Document URL Alias
keywords string Document keyword
description string Document Introduction
module_id int Document Model ID
category_id int Document Category ID
Views int Document Views
Comment Count int Document Comment Volume
Images string array document group chart
Logo string document logo
thumbnail string document thumbnail
flag string Document recommendation attribute, headline [h] recommendation [c] slide [f] featured [a] scroll [s] bold [h] image [p] jump [j]
canonical_url string canonical URL
fixed link string document fixed link
created_time int document publish timestamp
updated_time int document update timestamp
status int document display status
user_id int user ID
price int price, in cents
stock int inventory quantity
user_id int user ID
extra object#extra Other fields information in the document
Extra other fields information in the document

extra According to the model settings, the field display is, the field structure is key => item: key is the name of the form field, item is the content:

Field name Type Description
name string field name
value string written value
default string Default value

example of data request

Parameter Value
moduleId 1
type page

Usage Example

Request example

GET /api/archive/list?moduleId=1&type=page HTTP/1.1
Host: your-domain.com
Content-Type: application/json

Response 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": "https://en.anqicms.com/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": "https://en.anqicms.com/help"
    }
  ],
  "msg": "",
  "total": 2
}

error code

Error code Description
0 OK
-1 Error, the reason is indicated in msg
1001 Not logged in
1002 Not authorized
200 API request OK