Second, API Basic Structure

2.1 Basic API Path and Request Method

All API interfaces can be 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 APIs require user authentication, the system uses JWT Token authentication method:

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

2.3 Request and response format

Request format:

  • All interfaces except file upload use JSON format to transmit data
  • Content-Type: application/
  • GET request parameters are passed through URL Query

Response format:

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

2.4 General Request Headers

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 the interface)