Retrieve model list interface

Get information about all content models (modules) in the system, including basic information and custom fields.

Points to note

  • The interface uses the GET method and does not require the submission of request body data
  • Access without login is possible
  • The results include built-in system models and custom models
  • Custom field information of the included model

Request address

{域名地址}/api/module/list

Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/module/list

Request Syntax

GET {域名地址}/api/module/list

Request Headers

This interface involves only public request headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Request parameters

None

Response header

This interface only involves public response headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Return parameters

Field name Type Description
code int Error code
msg string Error description
data object[] Model list data

data result item parameter

Field name Type Description
id int Model ID
Title string Model name
Table Name string Additional Table Name
URL Token string Model URL alias
is_system int Is the system built-in model (1:Yes, 0>No)
Title Name string Title field name
Fields object[] Model Custom Field List
created_time int Timestamp of creation
updated_time int update timestamp
status int Model display status (1:Enabled, 0:Disabled)

Model Custom Field fields item Parameter

Field name Type Description
name string Field Chinese Name
field_name string Field English Name
type string Field Type (text,textarea,int,bool,etc.)
required boolean Mandatory?
is_system boolean Whether the field is built-in in the system
is_filter boolean Whether the filtering parameter
follow_level boolean Whether to follow the document reading level
content string Default field value

Usage Example

Request example

GET /api/module/list HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json

Response Example

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 1,
      "created_time": 1689603570,
      "updated_time": 1689924577,
      "table_name": "article",
      "url_token": "news",
      "title": "文章中心",
      "fields": null,
      "is_system": 1,
      "title_name": "标题",
      "status": 1
    },
    {
      "id": 2,
      "created_time": 1689603570,
      "updated_time": 1702908648,
      "table_name": "product",
      "url_token": "product",
      "title": "产品中心",
      "fields": [
        {
          "name": "产品参数",
          "field_name": "canshu",
          "type": "text",
          "required": false,
          "is_system": false,
          "is_filter": false,
          "follow_level": false,
          "content": ""
        },
        {
          "name": "批号",
          "field_name": "pihao",
          "type": "text",
          "required": false,
          "is_system": false,
          "is_filter": false,
          "follow_level": false,
          "content": ""
        }
      ],
      "is_system": 1,
      "title_name": "产品名称",
      "status": 1
    }
  ]
}

error code

Error code Description
0 OK
-1 Error, the reason is indicated in msg
1001 Not logged in
1002 Not authorized
200 API request OK