When using Anqí CMS for website content management and development, we often obtain various data through API interfaces, including retrieving document details (/api/archive/detailThis is very commonly used. When you call this interface, if you encounter system return codes 1001 or 1002, this usually indicates that the request was not successfully processed and specific reasons were given.Understand the meaning and solutions of these error codes, which can help us more efficiently troubleshoot problems and ensure the normal display of website content.

Error code 1001: Not logged in

When you try to get the document details, if the system returns error code 1001, this clearly indicates that your current session has not passed the user identity verification of Anqicms.In simple terms, it is that the system does not recognize who you are, or you have not told the system who you are.

Common cause analysis:

  1. Not logged in:You may not have logged in yet, or the login status of the user has expired in the front-end page/client application.
  2. Session expired: The user had previously logged in, but due to long inactivity or other security policies, the login session (such as the stored Token) has expired and needs to be retrieved again.
  3. Content restricted: You are trying to access a document detail that has been set to 'Visible to logged-in users', but your current request does not carry valid login credentials.

Solution:The most direct solution is to perform user login. Anqi CMS provides a login interface (usually/api/login),Through this interface, after successfully logging in, the system will return a user token (usually a Token). You need to make sure that this Token is correctly attached to the request header in subsequent API requests (for example,AuthorizationField) or send as a request parameter. For a frontend application, this means you need to implement a login process and store the obtained Token securely (such as in LocalStorage or Cookie) so that it can be carried with each request that needs to authenticate the interface.If the Token expires, the user needs to be redirected to log in again to obtain a new Token.

Error code 1002: Unauthorized

The error code 1002 means that although you have logged in and the system has identified your identity, your account does not have sufficient permissions to access the details of the requested document.This is like entering a club, but some VIP areas are not accessible to regular members.

Common cause analysis:

  1. Document permission settings: You may try to access a document that is set by the security CMS background to be accessible only to specific user groups or permission levels (such as VIP content, paid content, internal materials, etc.).
  2. Insufficient group permissions:The user group to which the account you are currently logged in belongs (such as the general member group) has not been granted access to this type of document or a specific document.
  3. Account status abnormal:Your account may be frozen, downgraded, or restricted for other reasons.
  4. Content Paid:If the document is a paid content, you may need to complete the payment first before you can view the details.

Solution:Resolve 1002 error by starting from the permission level:

  • Confirm document permissions:In the Anqi CMS backend management interface, find the document you are trying to access, check its 'reading level', 'access permissions', or related settings, and confirm whether the document is open to all users or only to specific user groups.
  • Verify user group:Check the user group of the current logged-in user account. If the document detail interface requires higher permissions, you may need to upgrade your user group (such as from a regular member to a VIP member), or contact the website administrator to adjust your user group permissions.The AnQi CMS backend user management module usually displays the user group and permissions of the user.
  • Contact administrator:If the above checks do not solve the problem, or you are not sure about the specific permission settings, the most effective way is to contact the website administrator.The administrator can view your account permissions, verify the document access settings, and then make necessary adjustments.
  • Check payment status:If the document is paid content, it needs to go through:archiveOrderCheckThe API to confirm if the payment has been made.

General Troubleshooting Suggestions

Whether you encounter errors 1001 or 1002, the following general troubleshooting steps may be helpful:

  • Please check the API request parameters carefully:Ensure that the document ID or filename you provide is correct and matches the existing document.An incorrect ID or filename may cause the system to be unable to find the document, thereby indirectly causing other errors.
  • View the complete API response information:Anqi CMS usually returns error codes whenmsgProvide more detailed error descriptions to help you quickly locate the problem. For example, prompts such as 'not logged in' or 'insufficient permissions' will appear directly.msgin the field.
  • Check network and server status:Ensure that your network connection is normal and the Aqian CMS server is running stably. Temporary network fluctuations or server maintenance may also cause API requests to fail.

By systematically analyzing error codes, combining the documents provided by Anqi CMS and the backend management features, you can efficiently solve these problems and ensure smooth access to website content.


Frequently Asked Questions (FAQ)

Q1: If the document detail interface does not return an error code, butdatawhat does it mean if the field is empty?A1: This usually means that the API request itself was successful, but the system was unable to find the corresponding document based on the document ID or filename provided.Please check if the document ID or filename you entered is correct, or if the document has been deleted, is in a non-display state (status is not 1), or has not been published.

Q2: Why did everything work fine during local testing, but errors 1001/1002 appeared after deployment to the server?A2: This situation is common. Possible reasons may include: Differences between the server environment and the local environment causing the Token to fail to pass;Cross-domain configuration problem prevents the browser from sending Token;Or the content permission settings on the server are more strict than the local ones.It is recommended to check the Nginx/Apache configuration of the server, the CORS strategy, and the user groups and document permission settings of the Anq CMS backend.

Q3: Is there any other way to manage user access to documents besides manually modifying permissions?A3: Yes. Anqi CMS usually supports user group management functions, you can create different user groups (such as ordinary users, VIP users, administrators, etc.), and configure different access permissions for each user group.Then, when publishing or editing a document, you can specify that the document is only visible to certain or a few user groups, so you can manage document access permissions in bulk without having to set up each user individually.In addition, some paid content modules may also integrate permission management based on payment status.