In addition to retrieving the details of a single document, does Anqi CMS provide an interface to obtain the list of documents under a specific category or model?

Calendar 👁️ 71

When building a website with AnQiCMS, we often have such questions: In addition to being able to accurately obtain the detailed information of a specific document, does the system also provide the function of obtaining a list of all documents under a certain category or model at one time?The answer is affirmative. Anqi CMS fully considers the flexibility of content management and display, providing powerful interfaces to meet such needs.

To get the document list under a specific category or model, it mainly relies on the Anqi CMS provided/api/archive/listThe interface is the core tool for displaying your content list. It not only allows you to filter by category and model, but also supports rich query and sorting functions.

Core feature explanation: How to get the list of documents

/api/archive/listThe interface allows you to flexibly define the range of documents you want to retrieve. Here are some key parameters and usage:

  1. Filter by model or category:

    • Model ID(moduleId)If you need to retrieve all documents under a specific model (such as the "article" model, "product" model), just pass the correspondingmoduleIdIt is. This is very useful for building different types of content lists (such as product display pages, blog list pages).
    • Category ID (categoryId): To get documents under a specific category, you can usecategoryIdParameter. What's more, it supports passing inmultipleCategory ID, separated by commas, which means you can retrieve document content from multiple categories at once. For example, if you want to display articles from both "News Updates" and "Industry Information" categories, you can do so bycategoryId="1,2"This way to implement.
  2. Containing sub-category documents(child): By default, when you specify a category ID, the interface usually includes all documents under its child categories. But if your requirement is to only getthe current categorythe document, excluding the content of its subcategories, can be controlled by settingchild=falseto precisely control.

  3. Pagination and quantity control (page,limit): In order to better manage data volume and implement pagination loading,archive/listThe interface providespageandlimitParameter.

    • Whentype="page"When you specifypageparameters to retrieve the content of the page number, the system will also return the total number of documents (total), which is crucial for building pagination navigation.
    • limitThe parameter is used to control the number of documents returned per page or per request. It even supports offset mode, for examplelimit="2,10"Represents starting from the second item and fetching 10 items, which is very practical in some special data slicing scenarios.
  4. Sorting (order): The order of content presentation is also important. You can useorderThe parameter specifies the sorting method, for exampleorder="created_time desc"You can get the latest documents,order="views desc"Then you can sort by views from high to low. The supported fields includeid/views/category_id/created_time/updated_timeetc.

  5. Featured content filtering(flag): Documents in AnQi CMS can be marked with different recommendation attributes (such as headline [h], recommended [c], slideshow [f], etc.). If you want to display only documents with specific attributes, you can useflagFilter parameters. For example,flag="c"Only documents marked as "Recommended" will be displayed.

  6. Keyword search (q) and custom filtering: Intype="page"mode, you can also useqThe parameter performs keyword search, matching content in the document title that contains specific words.In addition, if you have set filterable custom fields in your document model, these fields can also be used as query parameters to achieve more refined content filtering.For example, if there is a custom fieldgenderYou can directly go throughgender=男to filter out all documents with male gender.

How to get the necessary ID?

In order to use/api/archive/listthe interface inmoduleIdandcategoryIdParameters, you may need to obtain these IDs first. Anqi CMS also provides the corresponding interface:

  • Get category list: Pass/api/category/listInterface, you can get the list of all categories or the list of categories under the specified model, so that you can find what you needcategoryId.
  • Get model list: Pass/api/module/listInterface, you can get all the content models defined in the system and get the correspondingmoduleId.
  • Get document filtering conditions: If you want to know which custom filter conditions a model supports, you can use/api/archive/filtersan interface that lists the available filter fields and options of the specified model.

In summary, Anqi CMS provides a comprehensive API that allows you not only to obtain detailed content of individual documents but also to organize and display document lists in an extremely flexible and powerful way, based on categories, models, recommended attributes, keywords, even custom fields.Whether it is building a blog article list, product display page, news center, or implementing complex filtering functions, these interfaces can provide solid support.


Frequently Asked Questions (FAQ)

1. Can I get the document list under multiple categories at the same time?

Of course you can. When calling/api/archive/listthe interface,categoryIdThe parameter supports passing in a comma-separated string, for examplecategoryId="1,5,9"So you can get all documents under these three categories at once.

2. How to query the filtering options of custom fields under a certain model?

If you are unsure about which custom fields are available for filtering in a content model, you can use/api/archive/filtersthe interface. Just pass the model'smoduleIdThe system will return all the selectable custom fields and their corresponding option lists, allowing you to build an accurate filter query.

3. How do I set the parameters to get the 10 latest published articles?

To get the 10 latest published articles, you can use/api/archive/listthe API and combine withorderandlimitParameters. The specific settings can beorder="created_time desc"then set by sorting by publication time in reverse orderlimit="10"to limit the number of returned articles to 10.

Related articles

What are the considerations for replacing `{domain address}` during deployment?

When using AnQiCMS for secondary development or integrating with external systems, you will often encounter placeholders like `{domain address}` in the API interface documentation.This represents the actual URL where your Aiqi CMS is deployed.Correctly replace this placeholder is the basis to ensure API call success and system stable operation.Understand the meaning behind it and master the precautions when replacing, which can help you interact with AnQiCMS more efficiently.Firstly, `{domain address}` is essentially a variable

2025-11-09

If the `images` field is `null`, does it mean that the document is not associated with any images?

When using AnQi CMS to manage website content, we often deal with API interfaces to retrieve or submit various data.Among them, image data is an indispensable part of the website content, and regarding the return form of the `images` field in the document, it sometimes causes some confusion: Does it really mean that the document has no pictures associated with it when the `images` field returns `null`?### Learn the concept of "Gallery" in Anqi CMS In the document structure of Anqi CMS, images are usually divided into several types: *

2025-11-09

How to quickly obtain the API details through a known document detail URL (such as `https://en.anqicms.com/anqicms`)?

In the daily operation of Anqi CMS, we often encounter such needs: we have a visible document detail page URL on a website, such as `https://en.anqicms.com/anqicms`, and we hope to quickly obtain the complete API details of this document through programming, including its title, content, SEO information, etc.The AnQi CMS provides a very convenient and intuitive interface to meet this need.

2025-11-09

Is the document content returned by the `data.content` field in HTML format, does it contain images or other rich media content?

When using AnQi CMS for website content management, we often obtain detailed document information through the `/api/archive/detail` interface.Among them, the `data.content` field carries the core content of the article.Many developers or operators who are new to the field may be curious, what does this field return, plain text or formatted rich text?Can it directly include images or videos and other multimedia content?### HTML formatted document content Based on the AnQi CMS API documentation and returned data examples

2025-11-09

Is there a recommended word limit or **practice** for the `description` field in the document details?

In the daily use of AnQi CMS, the `description` field is a seemingly insignificant but extremely important part.It is not just a brief summary of the content, but also a bridge of communication between the website content, search engines, and users.A well-written description that can effectively improve the click-through rate of articles in search results and help search engines better understand the content theme.According to the AnQi CMS documentation, when publishing or importing a document (archive), the `description` field has a clear recommendation

2025-11-09

How to get the list of all tags (Tags) associated with the current document details?

In AnQi CMS, tags are important tools for organizing content, enhancing user experience, and optimizing search engine rankings.They can help visitors find relevant content quickly, and also allow website administrators to better manage information.When we browse the details page of a document, we often hope to see a list of all tags associated with the document, which can not only guide users to discover more relevant content, but also enrich the semantic structure of the page.To obtain the tag list associated with a specific document, we usually need to perform two steps: first, determine the unique identifier of the target document

2025-11-09

The `data.category` field (such as 1 or 3) represents what type of attribute the classification has?

When using Anq CMS for website content management or secondary development, you may notice that in the data returned by the classification or document detail interface, there is a `type` field under `data.category`. This field's value is usually `1` or `3`, what does it represent in terms of classification, and what practical significance does it have for our content organization and website presentation?Understanding this is very critical for more efficient use of Anqi CMS for website content planning and maintenance.In short

2025-11-09

How to implement the increase of document views (`views`) or update of other fields through API?

When you are running a website, you often need to manage content data in a fine-grained manner, such as tracking the number of views of articles, or modifying other properties of documents in specific scenarios.AnQiCMS provides a powerful API interface, making these operations possible.This article will introduce you in detail on how to use these interfaces to increase the document page views or update other fields. ## Learn about the API interaction mode of Anqi CMS In Anqi CMS, operations on document data are mainly divided into retrieval (read) and writing (creation/modify).for reading data

2025-11-09