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

Calendar 👁️ 74

In the daily operation of AnQi CMS, we often encounter such needs: we have a visible document detail page URL on a website, such ashttps://en.anqicms.com/anqicmsWe 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.

To achieve this goal, we mainly rely on the "Get Document Details Interface" provided by Anqi CMS (/api/archive/detail)。This interface is designed to be very flexible, it not only supports querying through the unique numeric ID of the document, but also cleverly supports querying through the "alias" in the URL of the document(filenameorurl_tokenSearch performed. It is this feature that makes it simple to extract API information from the known document detail URL.

The core idea is like this:

Firstly, you need to identify your security CMS websitedomain addressFor example, if your document detail page ishttps://www.yourdomain.com/your-article-alias, then your domain address ishttps://www.yourdomain.com.

Next, from the document detail URL you know, we need to extract the document's 'URL alias'. Forhttps://en.anqicms.com/anqicmsit is obvious that,anqicmsThis is the URL alias of the document. This alias is usually referred to in the document management of AnQi CMS.url_tokenorfilename.

With the domain address and document alias, we can construct API requests. The call address for the document detail interface is{域名地址}/api/archive/detailand it usesGETMethod. We will use the document alias extracted asfilenamepass the parameter to this API.

So, forhttps://en.anqicms.com/anqicmsthe corresponding API request for this URL will be:

GET https://en.anqicms.com/api/archive/detail?filename=anqicms

After you send this GET request, the backend of Anq CMS will handle this request and return a JSON formatted data packet.This package will contain all the details of the document.codeThe field indicates whether the request was successful,msgThe field provides message information, and all the document data we are concerned about will be encapsulated in,datain the field.

IndataThe field, where you can find the document's,id/title(Title),seo_title(SEO title),keywords(Keywords),description(Introduction), as well as the most importantdataobject, its internalcontentfields are the detailed content of the document. In addition, there are such ascategory(Categorization information),images(Group photos),logo(Document logo),thumb(Thumbnail) and rich data can help you fully understand and utilize the document information.

This method of obtaining document details through URL aliases provides great convenience for those who need to dynamically render content on the front end, build custom applications, or integrate data.You do not need to know the document's numeric ID in advance, just extract the key part from the friendly URL the user accesses.

It should be noted that in actual operation, please be sure to use the examples in{域名地址}Replace with your actual website domain to ensure that API requests are sent correctly to your Anqi CMS instance.


Frequently Asked Questions (FAQ)

1. Can I get the API details if I only have the numeric ID of the document and not the URL alias?

Of course you can. Anqi CMS' 'Get Document Details Interface' supports two methods of query: you can pass in the numeric ID of the document asidparameters, for examplehttps://en.anqicms.com/api/archive/detail?id=1, with the same effect as usingfilenameThe parameters are the same. Usually, if both are known, using ID is a bit more direct.

2. Where is the actual content of the document in the data returned by the API? I see many fields, but no text.

The actual text content of the document is usually nested indatain the child object of the field. Specifically, you need to finddata.data.contentthis path. For example, in the returned JSON, you will see something similar"data": { "id": 1, "content": "<p>欢迎使用AnqiCMS</p>" }such a structure, in which thecontentThe field is the main text of the document you are looking for.

3. If my document URL structure is complex, for examplehttps://en.anqicms.com/category/sub-category/my-article-nameHow can I extract,filename?

In most cases, Anqi CMS will place the document's URL alias (filenameorurl_token) at the end of the URL path. Forhttps://en.anqicms.com/category/sub-category/my-article-namesuch a structure, itsfilenameusually ismy-article-name. You can parse the URL path to get the last slash/The part to be retrieved later.If your website has enabled staticization and the rules are quite special, you may need to refer to your website's backend configuration to determine the actual location of the URL alias.

Related articles

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

How to use the `module_id` in the document details to query all the filterable parameter fields under the model?

In AnQi CMS, in order to better organize and display content, we often use document models and custom fields.When you want to provide a more flexible filtering function for documents under a specific model, for example, to search based on the attributes of a document such as 'city' or 'education', you need to know how to obtain these filterable parameter fields. This is usually a two-step process: first, we need to determine the model ID of the target document (`module_id`), which is the key to connecting the document with the model definition; then

2025-11-09

How to use the `msg` field for precise error checking when the document detail interface returns `code: -1`?

Guide to troubleshooting when the AnQiCMS document detail interface returns `code: -1` When using AnQiCMS for website content management, we often use the provided API interface to retrieve or manipulate data.When calling the document detail interface (for example, `/api/archive/detail`), if the returned result contains a `code` field of `-1`, this usually means that the request was not successful, and an error occurred during the server-side processing.In such a situation, many users may feel confused

2025-11-09

Does the `user_id` field in the document details indicate the document publisher or author ID?

When managing website content in AnQi CMS, we often encounter various data fields, among which the `user_id` field is a common and easily questionable identifier.When we retrieve document details from Anqi CMS, what does this `user_id` represent, the publisher or the author?To clearly understand this point, we need to analyze the data structure returned by the document interface.Firstly, from the `archiveDetail.md` document to get the API return parameters of the document details view

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

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

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?

When building a website with AnQiCMS, we often have such doubts: In addition to being able to accurately obtain the detailed information of a specific document, does the system also provide a function to obtain 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 retrieve the document list under a specific category or model, it mainly relies on the `/api/archive/list` interface provided by AnQi CMS

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