One, Quick Start

1.1 What is AnQiCMS API

AnQiCMS is an open-source content management system developed in Go language, providing a complete API interface for developers to call.The API uses RESTful design style, supports data interaction in JSON format, and allows developers to interact with the system through HTTP requests to retrieve, create, update, or delete content.

1.2 Basic Concepts of API

  • API Base Path:/api- All API requests must use this path as a prefix
  • Authentication MethodAuthentication is required for some interfaces, using JWT Token for identity verification
  • Request formatAll interfaces use JSON format for data transmission, except for file upload
  • Response format: Return data in JSON format uniformly

1.3 Example of the First API Call

For example, to get the list of articles, this article introduces a complete API call process:

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

Successful response:

{
  "code": 0,
  "msg": "",
  "total": 100,
  "data": [...]
}

Error handling:

{
  "code": -1,
  "msg": "API 接口未开放"
}