2. API Basic Structure

2.1 API Basic Path and Request Method

All API interfaces are accessed through the following basic path:

{域名地址}/api/接口路径

For example:https://en.anqicms.com/api/archive/list

API supported HTTP request methods include:

  • GET- Retrieve data
  • POST- Create data or submit a form, update data, delete data

2.2 Authentication method

Some interfaces require user authentication, the system uses JWT Token authentication:

  • Get Token after login
  • Carry Token in the request header
  • Format:Token: {token}

2.3 Request and Response Format

Request Format:

  • All interfaces use JSON format for data transmission except for file upload
  • Content-Type: application/
  • GET request parameters are passed through URL query

Response format:

{
  "code": 0,
  "msg": "",
  "data": {}
}

2.4 General Request Header

All API interfaces follow the following general request header specifications:

Field name Type Description
Content-Type string Fixed value: application/
Token string JWT Authentication Token (requires authentication for interfaces)