# 获取表单数据列表 API

获取表单数据列表,使用 GET 发起请求,请求地址为 /api/v1/forms,此接口可以直接访问,无需身份验证。

GET /api/v1/forms

# 请求 URI

参数名 类型 必填 说明
siteId query 整数
formId query 整数
formName query 字符串
page query 整数
perPage query 整数
word query 字符串

请求 URI 可以通过传递 formId 表单 Id,也可以通过传递 formName 表单名称确定需要表单。

# 返回

名称 类型 说明
items FormData 数组 表单数据列表
total 整数 表单数据总数
pageSize 整数 每页将返回的个数
styles 数组 表单样式列表
allAttributeNames 数组 表单字段名称列表
listAttributeNames 数组 显示在列表页的表单字段名称列表
isReply 布尔值 表单是否需要回复
columns 数组 表单字段列表

# 示例

# 请求示例

GET /api/v1/forms?siteId=1&formName=表单名称&page=1&perPage=30
Content-Type: application/json

# 返回示例

{
  "items": [
    {
      "name": "姓名2",
      "mobile": "13911111111",
      "email": "demo@ss.com",
      "content": "留言内容",
      "siteId": 1,
      "channelId": 0,
      "contentId": 0,
      "formId": 2,
      "isReplied": false,
      "replyDate": null,
      "replyContent": null,
      "id": 2,
      "guid": "844a505f-373d-443a-a771-19aa2d6ce7de",
      "createdDate": "2023-11-16 10:55:23",
      "lastModifiedDate": "2023-11-16 10:55:23"
    },
    {
      "name": "姓名",
      "mobile": "13888888888",
      "email": "demo@site.com",
      "content": "留言",
      "siteId": 1,
      "channelId": 0,
      "contentId": 0,
      "formId": 2,
      "isReplied": false,
      "replyDate": null,
      "replyContent": null,
      "id": 1,
      "guid": "6d9126d9-1545-4532-b948-ba54e3304b2c",
      "createdDate": "2023-11-16 10:55:03",
      "lastModifiedDate": "2023-11-16 10:55:03"
    }
  ],
  "total": 2,
  "pageSize": 30,
  "styles": [
    {
      "relatedIdentity": 2,
      "tableName": "siteserver_FormData",
      "attributeName": "Name",
      "taxis": 1,
      "displayName": "姓名",
      "helpText": "请输入您的姓名",
      "list": false,
      "inputType": "Text",
      "defaultValue": null,
      "horizontal": false,
      "items": null,
      "rules": [
        { "type": "Required", "value": null, "message": "字段为必填项" }
      ],
      "isSystem": false,
      "itemValues": null,
      "ruleValues": "[\r\n  {\r\n    \"type\": \"Required\",\r\n    \"value\": null,\r\n    \"message\": \"字段为必填项\"\r\n  }\r\n]",
      "height": 0,
      "isFormatString": false,
      "relatedFieldId": 0,
      "customizeCode": null,
      "id": 27,
      "guid": "539f5617-7698-44dd-bebf-5156c986b8cb",
      "createdDate": "2023-11-15 15:53:59",
      "lastModifiedDate": "2023-11-15 15:53:59"
    },
    {
      "relatedIdentity": 2,
      "tableName": "siteserver_FormData",
      "attributeName": "Mobile",
      "taxis": 2,
      "displayName": "手机",
      "helpText": "请输入您的手机号码",
      "list": false,
      "inputType": "Text",
      "defaultValue": null,
      "horizontal": false,
      "items": null,
      "rules": [
        {
          "type": "Mobile",
          "value": null,
          "message": "字段必须是有效的手机号码"
        }
      ],
      "isSystem": false,
      "itemValues": null,
      "ruleValues": "[\r\n  {\r\n    \"type\": \"Mobile\",\r\n    \"value\": null,\r\n    \"message\": \"字段必须是有效的手机号码\"\r\n  }\r\n]",
      "height": 0,
      "isFormatString": false,
      "relatedFieldId": 0,
      "customizeCode": null,
      "id": 28,
      "guid": "5c67a7c9-2ba8-462e-9857-9f25be009d28",
      "createdDate": "2023-11-15 15:53:59",
      "lastModifiedDate": "2023-11-15 15:53:59"
    },
    {
      "relatedIdentity": 2,
      "tableName": "siteserver_FormData",
      "attributeName": "Email",
      "taxis": 3,
      "displayName": "邮箱",
      "helpText": "请输入您的电子邮箱",
      "list": false,
      "inputType": "Text",
      "defaultValue": null,
      "horizontal": false,
      "items": null,
      "rules": [
        {
          "type": "Email",
          "value": null,
          "message": "字段必须是有效的电子邮件"
        }
      ],
      "isSystem": false,
      "itemValues": null,
      "ruleValues": "[\r\n  {\r\n    \"type\": \"Email\",\r\n    \"value\": null,\r\n    \"message\": \"字段必须是有效的电子邮件\"\r\n  }\r\n]",
      "height": 0,
      "isFormatString": false,
      "relatedFieldId": 0,
      "customizeCode": null,
      "id": 29,
      "guid": "f593bff2-5cb4-4fa2-99d3-8f45ae39cced",
      "createdDate": "2023-11-15 15:53:59",
      "lastModifiedDate": "2023-11-15 15:53:59"
    },
    {
      "relatedIdentity": 2,
      "tableName": "siteserver_FormData",
      "attributeName": "Content",
      "taxis": 4,
      "displayName": "留言",
      "helpText": "请输入您的留言",
      "list": false,
      "inputType": "TextArea",
      "defaultValue": null,
      "horizontal": false,
      "items": null,
      "rules": [
        { "type": "Required", "value": null, "message": "字段为必填项" }
      ],
      "isSystem": false,
      "itemValues": null,
      "ruleValues": "[\r\n  {\r\n    \"type\": \"Required\",\r\n    \"value\": null,\r\n    \"message\": \"字段为必填项\"\r\n  }\r\n]",
      "height": 0,
      "isFormatString": false,
      "relatedFieldId": 0,
      "customizeCode": null,
      "id": 30,
      "guid": "b8e96b87-6fa4-4f1d-98a0-487c4cc769ba",
      "createdDate": "2023-11-15 15:53:59",
      "lastModifiedDate": "2023-11-15 15:53:59"
    }
  ],
  "allAttributeNames": [
    "Id",
    "Guid",
    "Name",
    "Mobile",
    "Email",
    "Content",
    "CreatedDate",
    "LastModifiedDate"
  ],
  "listAttributeNames": ["Name", "Mobile", "Email", "Content"],
  "isReply": false,
  "columns": [
    {
      "attributeName": "Id",
      "displayName": "Id",
      "inputType": "Text",
      "width": 0,
      "isList": false,
      "isSearchable": false
    },
    {
      "attributeName": "Guid",
      "displayName": "编号",
      "inputType": "Text",
      "width": 0,
      "isList": false,
      "isSearchable": false
    },
    {
      "attributeName": "Name",
      "displayName": "姓名",
      "inputType": "Text",
      "width": 0,
      "isList": true,
      "isSearchable": false
    },
    {
      "attributeName": "Mobile",
      "displayName": "手机",
      "inputType": "Text",
      "width": 0,
      "isList": true,
      "isSearchable": false
    },
    {
      "attributeName": "Email",
      "displayName": "邮箱",
      "inputType": "Text",
      "width": 0,
      "isList": true,
      "isSearchable": false
    },
    {
      "attributeName": "Content",
      "displayName": "留言",
      "inputType": "TextArea",
      "width": 0,
      "isList": true,
      "isSearchable": false
    },
    {
      "attributeName": "CreatedDate",
      "displayName": "添加时间",
      "inputType": "Text",
      "width": 0,
      "isList": false,
      "isSearchable": false
    },
    {
      "attributeName": "LastModifiedDate",
      "displayName": "更新时间",
      "inputType": "Text",
      "width": 0,
      "isList": false,
      "isSearchable": false
    },
    {
      "attributeName": "ChannelId",
      "displayName": "所在栏目页",
      "inputType": "Text",
      "width": 0,
      "isList": false,
      "isSearchable": false
    },
    {
      "attributeName": "ContentId",
      "displayName": "所在内容页",
      "inputType": "Text",
      "width": 0,
      "isList": false,
      "isSearchable": false
    }
  ]
}
上次更新: 2023/12/11 下午2:51:09