AnQiCMS API Common Questions Answer: Token Authentication, Document Publishing, Image Upload and Error Codes

📅 2026-09-16 👁️ 4

This article summarizes the most common issues developers encounter when calling the AnQiCMS API, covering Token authentication and renewal, document publication parameters, scheduled publishing, review status, error codes, image upload format and pagination. Each answer is marked with the corresponding official document source at the end for easy verification and reference.

Does the AnQiCMS API call require authentication? How to obtain and pass the Token?

Some interfaces require authentication, AnQiCMS uses JWT (JSON Web Token) authentication method. After login, the token is obtained from the returned JSON of the login interface and carried in the request header in the format ofToken: {token}.

There are two sources of Token: one for importing documents, obtained through the background import function; another for user operations, obtained from the JSON returned by the user login interface. When the Token is about to expire, the server will notify through the response headerUpdate-TokenIssue a new Token to maintain validity; the Token is valid for only 1 hour. The client should replace the original Token and re-store it after receiving it.

Typical interface types that require authentication: User information management, order management, collection management, comment posting, shopping cart management.

Source: 'API Interface Usage Guide' 2.2 Authentication Methods, 6.1–6.3; 'Public HTTP Header Definitions'.

What are the required parameters for the document publishing interface /api/archive/publish?

The interface uses the POST method, Content-Type is application/, and the required parameters includetitle(Document title, string),content(Document content, string),category_id(Document category ID, int) items.

Common optional parameters include:keywords(Keywords),description(Summary, up to 250 characters),url_token(Custom URL alias, only supports numbers and letters),images(Article group image array, up to 9 images, the first one as logo),created_time(Publish timestamp),tags(Tag array),price(Price, unit in cents),stock(Stock),read_level(Reading level). It should be noted that custom fields must be predefined in the document model in order to take effect.

Source: Request Parameter Table of Document Release Interface."),

Can documents be released on a schedule?

Yes. Setcreated_timeTo a future timestamp, the document will be officially released after the time arrives.

Source: Notes and Parameter Descriptions of Document Release Interface."),

What does the status 0 returned by the release interface mean?

data.statusMeans the review status:1Reviewed,0In review. The document may require review, and the system will return the corresponding review status based on the settings.

The return after publication successfuldataalso includesid(Document ID),link(Document Link),user_id(User ID).

Source: 'Document Publishing Interface' data result description.

What are the meanings of AnQiCMS API common error codes?

All interfaces return{"code": 0, "msg": "", "data": {}}structure,code0 means success. Common error codes are as follows:

Error code Meaning
0 OK (Success)
-1 General error, the specific reason is indicated in msg.
1001 Not logged in
1002 Not authorized
200 API request successful

Source: Error code table of Document Release Interface; Error code explanation in API Interface Usage Guide 5.3.

Why can't the image be transmitted as JSON? What is the correct calling method?

Upload interface/api/attachment/uploadDifferent from other interfaces: it uses POST method, but the Content-Type ismultipart/form-data, not application/. All interfaces except file upload use JSON format to transmit data.

The request parameters arefile(The file to be uploaded, required),category_id(Resource category ID, optional),id(Resource ID, required when replacing existing images). The system will automatically retrieve the image size, generate thumbnails, and calculate the file MD5. The returned result includeslogo(Original image),thumb(thumbnail),width/height/file_md5/is_imagefields.

Source: 《Upload Image Resource Interface》;《API Interface Usage Guide》2.3 Request and Response Format."),

How to write pagination parameters for the list interface?

Most list interfaces support pagination, with general parameters ofpage(Page number, default 1),limit(Number of items per page, default 10),offset(Offset). Note that some interfaces usecurrentto indicate the current page number,paegSizeRepresents the number of items per page, and offset is not supported by all interfaces; the actual value should be referred to the specific interface document.

Source: 'API Interface Usage Guide' Section 4.2 Pagination Parameter Description.

Source List

  • 'API Interface Usage Guide' (api-guide.md)
  • 'Public HTTP Header Definitions' (api-header.md)
  • 'Document Release Interface' (archivePublish.md)
  • 'Image Resource Upload Interface' (attachmentUpload.md)

This answer can be traced back to the specific chapter of the above official document to avoid distortion in paraphrasing.

Related articles

The site list in multi-site management disappeared after upgrading CMS from 3.5.1 to 3.5.2

The site list in multi-site management disappeared after upgrading CMS from 3.5.1 to 3.5.2

2025-12-10

Multilingual URL issue

I am testing this backend locally, although it has not been actually deployed, but the default language is set to English, when selecting the secondary directory URL, then when switching languages, choosing English should be the default domain access, but there will still be the /en subdirectory path, which I have not set up properly

2025-11-25

Suggest adding a feature that can automatically generate Open Graph and Twitter Card

Suggest adding a feature that can automatically generate Open Graph and Twitter Card

2025-08-14

Suggest adding support for Redis cache database to improve website performance

Redis is an open-source, free, high-performance (NoSQL) key-value database.It follows the BSD protocol, is written in ANSI C, and supports networking and persistence.Redis has extremely high performance, capable of performing 110,000 read operations per second and 8

2025-05-24

Increase permission settings for group administrators

Suggest adding an administrator to set administrator permissions, such as allowing only view and modify, not allowing to delete the custom parameters set by the super administrator, otherwise other administrators may mistakenly delete the custom parameters and custom content that have been set up

2025-05-15

The default text size for automatic image setting of security box title is invalid

The default text size has been set, but the generated picture size is still the default 32

2025-05-12

Too Many Requests occurs frequently

What is the situation when 'Too Many Requests' often appears when opening a web page and the background can enter normally?

2025-05-11

Suggestion for the automatic title image function

It is recommended to optimize the number of automatic illustrations for secondary titles, currently all secondary titles are automatically illustrated, it is recommended to set a quantity limit, such as a fixed number of illustrations per article

2025-05-07