1.1 What is AnQiCMS API
AnQiCMS is an open-source content management system developed based on the Go programming language, providing a complete API interface for developers to call.The API uses RESTful design style, supports JSON data interchange, and allows developers to interact with the system through HTTP requests to obtain, create, update, or delete content.
1.2 Basic Concepts of API
- API Base Path:
/api- All API requests must be prefixed with this path - Authentication Method: Some interfaces require authentication, using JWT Token for identity verification
- Request format: All interfaces except file upload use JSON format for data transmission
- response format: Use JSON format to return data uniformly
1.3 The first API call example
Take getting a list of articles as an example, to introduce 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 接口未开放"
}