- 1. 数据填报
- 1.1. GET 获取填写的表单数据
 - 1.2. GET 获取填报模板列表
 - 1.3. POST 创建填报模板
 - 1.4. GET 根据ID查询模板模板
 - 1.5. PUT 更新填报模板
 - 1.6. DELETE 删除填报模板
 - 1.7. GET 获取填报表单信息
 - 1.8. POST 填写表单
 - 1.9. GET 获取填报模板设置
 - 1.10. PUT 修改填报模设置
 - 1.11. PUT 开启共享链接
 - 1.12. POST 创建填报模板副本
 - 1.13. PUT 更新填写的数据
 - 1.14. DELETE 删除填写的数据
 - 1.15. POST 根据条件查询填写的表单数据
 - 1.16. GET 下载模板
 - 1.17. POST 导入数据(填报管理员)
 - 1.18. GET 获取导入数据失败的错误提示文件(填报管理员)
 - 1.19. GET 异步请求下载文件
 - 1.20. GET 租户查询平台授权模板列表
 - 1.21. POST 导出数据(填报管理员)
 - 1.22. POST 导入数据
 - 1.23. GET 获取导入数据失败的错误提示文件
 
 - 2. 数据模型
 
1. 1. 数据填报
1.1. 1.1. GET 获取填写的表单数据
GET /api/surveys/{id}/data
获取填写的表单数据,仅表单所有者有权限进行查看。
1.1.1. 1.1.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| offset | query | integer | 否 | none | 
| limit | query | integer | 否 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": {
    "data": [
      [
        "你的名字",
        32,
        2,
        null,
        "2023-08-10 17:58:58.000",
        2,
        null,
        "2023-08-10 17:58:58.000",
        "a5048bef2ee54b2bbe83f80f90783a0c"
      ],
      [
        "你的名字",
        32,
        2,
        null,
        "2023-08-10 18:02:09.000",
        2,
        null,
        "2023-08-10 18:02:09.000",
        "c435f5029fb940abb20cac9fdb3abfc5"
      ],
      [
        "as da",
        null,
        2,
        null,
        "2023-08-10 18:05:23.000",
        2,
        null,
        "2023-08-10 18:05:23.000",
        "86cd0e76dcd345ccb3f08fc6f39d9783"
      ]
    ],
    "mapData": [],
    "schema": [
      {
        "fieldName": "name",
        "tags": {},
        "defaultAggrType": "count",
        "basicType": "string",
        "suggestedTypes": [
          "string"
        ],
        "hideValue": false,
        "nativeType": "LONGTEXT",
        "originType": "string",
        "oriName": "01H7FBCSERDZJG59S52TKJTQ7K",
        "visible": true,
        "config": {},
        "type": "string",
        "label": "你叫什么呀",
        "comment": "你叫什么呀"
      },
      {
        "fieldName": "age",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "nativeType": "NUMERIC(65,10)",
        "originType": "number",
        "oriName": "01H7FBE8TNVNJ0257YSPQMNNJF",
        "visible": true,
        "config": {},
        "type": "number",
        "label": "年龄多少",
        "comment": "年龄多少"
      },
      {
        "fieldName": "hs_updater_id",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "originType": "integer",
        "visible": true,
        "config": {},
        "type": "number"
      },
      {
        "fieldName": "hs_updater_company",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "originType": "integer",
        "visible": true,
        "config": {},
        "type": "number"
      },
      {
        "fieldName": "hs_update_time",
        "tags": {},
        "defaultAggrType": "year",
        "basicType": "date",
        "suggestedTypes": [
          "date"
        ],
        "hideValue": false,
        "originType": "time",
        "visible": true,
        "config": {},
        "type": "date"
      },
      {
        "fieldName": "hs_user_id",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "originType": "integer",
        "visible": true,
        "config": {},
        "type": "number"
      },
      {
        "fieldName": "hs_user_company",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "originType": "integer",
        "visible": true,
        "config": {},
        "type": "number"
      },
      {
        "fieldName": "hs_create_time",
        "tags": {},
        "defaultAggrType": "year",
        "basicType": "date",
        "suggestedTypes": [
          "date"
        ],
        "hideValue": false,
        "originType": "time",
        "visible": true,
        "config": {},
        "type": "date"
      },
      {
        "fieldName": "hs_row_id",
        "tags": {},
        "defaultAggrType": "count",
        "basicType": "string",
        "suggestedTypes": [
          "string"
        ],
        "hideValue": false,
        "originType": "string",
        "visible": true,
        "config": {},
        "type": "string"
      }
    ],
    "pagable": true,
    "importSwitchable": true,
    "totalHits": 3
  },
  "chartDataStartTimeMillis": 0
}
1.1.2. 1.1.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.1.3. 1.1.3. 返回数据结构
1.2. 1.2. GET 获取填报模板列表
GET /api/surveys
返回包含简单填报模板信息的列表。
1.2.1. 1.2.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| title | query | string | 否 | 填报模板名字 | 
| orderBy | query | string | 否 | none | 
| orderType | query | string | 否 | none | 
| offset | query | integer | 否 | none | 
| limit | query | integer | 否 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": [
    {
      "id": 30,
      "title": "演示接口1",
      "status": "CLOSED",
      "createdBy": 2,
      "createdAt": "2023-08-10 16:53:28",
      "updatedBy": 2,
      "updatedAt": "2023-08-10 16:53:28",
      "options": {
        "version": 4.4
      }
    },
    {
      "id": 29,
      "title": "新建一个演示一下",
      "formTitle": "一个表单",
      "status": "OPEN",
      "connectionId": 50,
      "tablePath": [
        "数据集成"
      ],
      "table": "test_810_1",
      "createdBy": 2,
      "createdAt": "2023-08-10 16:36:41",
      "updatedBy": 2,
      "updatedAt": "2023-08-10 17:47:45",
      "options": {
        "submitButton": {
          "title": "提交"
        },
        "resetButton": {
          "title": "重制",
          "enable": true
        },
        "canUpdateData": true,
        "canLookupData": true,
        "canImportData": true,
        "version": 4.4
      }
    }
  ],
  "totalHits": 22,
  "offset": 0,
  "chartDataStartTimeMillis": 0
}
1.2.2. 1.2.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.2.3. 1.2.3. 返回数据结构
1.3. 1.3. POST 创建填报模板
POST /api/surveys
创建数据填报模板。
Body 请求参数
{
  "title": "string"
}
1.3.1. 1.3.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| body | body | object | 否 | none | 
| » title | body | string | 是 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": {
    "id": 30,
    "title": "演示接口1",
    "status": "CLOSED",
    "createdBy": 2,
    "createdAt": "2023-08-10 16:53:28",
    "updatedBy": 2,
    "updatedAt": "2023-08-10 16:53:28",
    "options": {
      "version": 4.4
    }
  },
  "chartDataStartTimeMillis": 0
}
1.3.2. 1.3.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.3.3. 1.3.3. 返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 | 
|---|---|---|---|---|---|
| » version | string | true | none | none | |
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » data | object | true | none | none | |
| »» id | integer | true | none | 模板id | |
| »» title | string | true | none | 模板名称 | |
| »» status | string | true | none | 模板填报开启状态 | |
| »» createdBy | integer | true | none | 模板创建者id | |
| »» createdAt | string | true | none | 模板创建时间 | |
| »» updatedBy | integer | true | none | 模板最后修改者 | |
| »» updatedAt | string | true | none | 模板最后修改时间 | |
| »» options | object | true | none | none | |
| »»» version | number | true | none | 模板当前版本 | |
| » chartDataStartTimeMillis | integer | true | none | none | 
1.4. 1.4. GET 根据ID查询模板模板
GET /api/surveys/{id}
根据id查询数据填报模板的详细信息。
1.4.1. 1.4.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": {
    "id": 29,
    "title": "新建一个演示一下",
    "formTitle": "一个表单",
    "status": "OPEN",
    "connectionId": 50,
    "tablePath": [
      "数据集成"
    ],
    "table": "test_810_1",
    "createdBy": 2,
    "createdAt": "2023-08-10 16:36:41",
    "updatedBy": 2,
    "updatedAt": "2023-08-10 17:47:45",
    "options": {
      "submitButton": {
        "title": "提交"
      },
      "resetButton": {
        "title": "重制",
        "enable": true
      },
      "canUpdateData": true,
      "canLookupData": true,
      "canImportData": true,
      "version": 4.4
    },
    "controls": [
      {
        "uuid": "01H7FBCSERDZJG59S52TKJTQ7K",
        "inputType": "singleLineText",
        "title": "你叫什么呀",
        "fieldName": "name",
        "required": true,
        "options": {
          "maxLength": 10,
          "placeholder": "输入姓名"
        }
      },
      {
        "uuid": "01H7FBE8TNVNJ0257YSPQMNNJF",
        "inputType": "numberInput",
        "title": "年龄多少",
        "fieldName": "age",
        "required": false,
        "options": {
          "maxValue": 100,
          "minValue": 0,
          "onlyInteger": true,
          "placeholder": "输入数字好吗"
        }
      }
    ]
  },
  "chartDataStartTimeMillis": 0
}
1.4.2. 1.4.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.4.3. 1.4.3. 返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 | 
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » data | object | true | none | none | |
| »» id | integer | true | none | 填报模板id | |
| »» title | string | true | none | 填报模板标题 | |
| »» table | string | true | none | 填报模板绑定数据库表名 | |
| »» createdBy | integer | true | none | 填报模版创建者id | |
| »» updatedBy | integer | true | none | 填报模板最后一次修改者id | |
| »» createdAt | string | true | none | 填报模板创建时间 | |
| »» updatedAt | string | true | none | 填报模板最后一次修改时间 | |
| »» options | object | true | none | none | |
| »»» submitButton | object | true | none | none | |
| »»»» title | string | true | none | 提交按钮文本 | |
| »»» resetButton | object | true | none | none | |
| »»»» enable | boolean | true | none | 是否提供重置按钮 | |
| »»»» title | string | true | none | 重置按钮文本 | |
| »»» canUpdateData | boolean | true | none | 能否更新历史填写的数据 | |
| »»» canLookupData | boolean | true | none | 能否查看历史填写的数据 | |
| »»» canImportData | boolean | true | none | 能否批量导入数据 | |
| »»» version | number | true | none | 当前填报模板版本 | |
| »» formTitle | string | true | none | 填报表单标题 | |
| »» status | string | true | none | 模板填报开启状态 | |
| »» connectionId | integer | true | none | 填报模板绑定数据连接id | |
| »» tablePath | [string] | true | none | 填报模板绑定数据库表路径 | |
| »» controls | [object] | true | none | 控件列表 | |
| »»» uuid | string | true | none | none | |
| »»» inputType | string | true | none | none | |
| »»» title | string | true | none | none | |
| »»» fieldName | string | true | none | none | |
| »»» required | boolean | true | none | none | |
| »»» options | object | true | none | none | |
| »»»» maxLength | integer | false | none | none | |
| »»»» placeholder | string | true | none | none | |
| »»»» maxValue | integer | true | none | none | |
| »»»» minValue | integer | true | none | none | |
| »»»» onlyInteger | boolean | true | none | none | |
| » version | string | true | none | none | |
| » msg | string | true | none | none | |
| » chartDataStartTimeMillis | integer | true | none | none | 
1.5. 1.5. PUT 更新填报模板
PUT /api/surveys/{id}
更新填报模板信息。
Body 请求参数
{
  "connectionId": 50,
  "tablePath": [
    "数据集成"
  ],
  "table": "test_810_1",
  "options": {
    "version": 4.4,
    "resetButton": {
      "enable": true,
      "title": "重制"
    },
    "canLookupData": true,
    "canUpdateData": true,
    "canImportData": true,
    "submitButton": {
      "title": "提交"
    }
  },
  "formTitle": "一个表单",
  "controls": [
    {
      "uuid": "01H7FBCSERDZJG59S52TKJTQ7K",
      "title": "你叫什么呀",
      "inputType": "singleLineText",
      "fieldName": "name",
      "required": true,
      "options": {
        "maxLength": 10,
        "placeholder": "输入姓名"
      }
    },
    {
      "uuid": "01H7FBE8TNVNJ0257YSPQMNNJF",
      "title": "年龄多少",
      "inputType": "numberInput",
      "fieldName": "age",
      "required": false,
      "options": {
        "maxValue": 100,
        "minValue": 0,
        "onlyInteger": true,
        "placeholder": "输入数字好吗"
      }
    }
  ]
}
1.5.1. 1.5.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | integer | 是 | none | 
| body | body | object | 否 | none | 
| » connectionId | body | integer | 否 | 模板绑定数据连接id | 
| » tablePath | body | [string] | 否 | 模板绑定数据库表路径 | 
| » table | body | string | 否 | 模板绑定数据库表名 | 
| » options | body | object | 否 | none | 
| »» submitButton | body | object | 否 | none | 
| »»» title | body | string | 否 | 提交按钮文本 | 
| »» resetButton | body | object | 否 | none | 
| »»» enable | body | boolean | 是 | 开启重置按钮 | 
| »»» title | body | string | 是 | 重置按钮文本 | 
| »» version | body | number | 否 | 模板版本号 | 
| »» canLookupData | body | boolean | 否 | 能否查看过往填写的数据数据 | 
| »» canUpdateData | body | boolean | 否 | 能否更新过往填写的数据 | 
| »» canImportData | body | boolean | 否 | 能否批量导入数据 | 
| » controls | body | [object] | 否 | 控件组 | 
| »» required | body | boolean | 否 | 是否必填 | 
| »» options | body | object | 否 | 各控件独有配置 | 
| »» uuid | body | string | 否 | 控件唯一标识 | 
| »» title | body | string | 否 | 控件标题 | 
| »» inputType | body | string | 否 | 控件类型 | 
| »» fieldName | body | string | 否 | 控件绑定数据表列名 | 
| » formTitle | body | string | 否 | 填报表单名称 | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "null",
  "data": {
    "id": 29,
    "title": "新建一个演示一下",
    "formTitle": "一个表单",
    "status": "CLOSED",
    "connectionId": 50,
    "tablePath": [
      "数据集成"
    ],
    "table": "test_810_1",
    "createdBy": 2,
    "createdAt": "2023-08-10 16:36:41",
    "updatedBy": 2,
    "updatedAt": "2023-08-10 17:20:16",
    "options": {
      "submitButton": {
        "title": "提交"
      },
      "resetButton": {
        "title": "重制",
        "enable": true
      },
      "canUpdateData": true,
      "canLookupData": true,
      "canImportData": true,
      "version": 4.4
    },
    "controls": [
      {
        "uuid": "01H7FBCSERDZJG59S52TKJTQ7K",
        "inputType": "singleLineText",
        "title": "你叫什么呀",
        "fieldName": "name",
        "required": true,
        "options": {
          "maxLength": 10,
          "placeholder": "输入姓名"
        }
      },
      {
        "uuid": "01H7FBE8TNVNJ0257YSPQMNNJF",
        "inputType": "numberInput",
        "title": "年龄多少",
        "fieldName": "age",
        "required": false,
        "options": {
          "maxValue": 100,
          "minValue": 0,
          "onlyInteger": true,
          "placeholder": "输入数字好吗"
        }
      }
    ]
  },
  "chartDataStartTimeMillis": 0
}
1.5.2. 1.5.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.5.3. 1.5.3. 返回数据结构
1.6. 1.6. DELETE 删除填报模板
DELETE /api/surveys/{id}
删除指定的数据填报模板。
1.6.1. 1.6.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "chartDataStartTimeMillis": 0
}
1.6.2. 1.6.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.6.3. 1.6.3. 返回数据结构
1.7. 1.7. GET 获取填报表单信息
GET /api/surveys/{id}/submit
返回填报表单配置。
1.7.1. 1.7.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | integer | 是 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": {
    "title": "新建一个演示一下",
    "formTitle": "一个表单",
    "status": "OPEN",
    "options": {
      "submitButton": {
        "title": "提交"
      },
      "resetButton": {
        "title": "重制",
        "enable": true
      },
      "canUpdateData": true,
      "canLookupData": true,
      "canImportData": true,
      "version": 4.4
    },
    "controls": [
      {
        "uuid": "01H7FBCSERDZJG59S52TKJTQ7K",
        "inputType": "singleLineText",
        "title": "你叫什么呀",
        "fieldName": "name",
        "required": true,
        "options": {
          "maxLength": 10,
          "placeholder": "输入姓名"
        }
      },
      {
        "uuid": "01H7FBE8TNVNJ0257YSPQMNNJF",
        "inputType": "numberInput",
        "title": "年龄多少",
        "fieldName": "age",
        "required": false,
        "options": {
          "maxValue": 100,
          "minValue": 0,
          "onlyInteger": true,
          "placeholder": "输入数字好吗"
        }
      }
    ]
  },
  "chartDataStartTimeMillis": 0
}
1.7.2. 1.7.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.7.3. 1.7.3. 返回数据结构
1.8. 1.8. POST 填写表单
POST /api/surveys/{id}/submit
提交填写的表单内容。以一组控件id与填写内容的键值对为RequestBody。
Body 请求参数
{
  "01H7FBCSERDZJG59S52TKJTQ7K": "你的名字",
  "01H7FBE8TNVNJ0257YSPQMNNJF": 32
}
1.8.1. 1.8.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | integer | 是 | none | 
| body | body | object | 否 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "chartDataStartTimeMillis": 0
}
1.8.2. 1.8.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.8.3. 1.8.3. 返回数据结构
1.9. 1.9. GET 获取填报模板设置
GET /api/surveys/{id}/setting
获取填报模板的额外配置设置信息。
1.9.1. 1.9.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | integer | 是 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": {
    "title": "新建一个演示一下",
    "status": "OPEN",
    "allowUsers": {
      "grantors": [
        {
          "id": 17,
          "action": "read",
          "email": "jyuser@qq.com",
          "name": "jyuser"
        }
      ],
      "organizations": [],
      "orgs": [],
      "tenants": []
    },
    "share": {
      "id": 21,
      "hash": "SB2330B099E73DA0832D8BC795D1CAB79",
      "options": {},
      "objectType": "survey",
      "objectId": 29,
      "createdBy": 2,
      "createdAt": "2023-08-10 17:42:39",
      "isDelete": false,
      "title": "新建一个演示一下",
      "enable": true
    },
    "isPlatformData": false
  },
  "chartDataStartTimeMillis": 0
}
1.9.2. 1.9.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.9.3. 1.9.3. 返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 | 
|---|---|---|---|---|---|
| » version | string | true | none | none | |
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » data | object | true | none | none | |
| »» title | string | true | none | none | |
| »» status | string | true | none | none | |
| »» allowUsers | object | true | none | none | |
| »»» grantors | [object] | true | none | none | |
| »»»» id | integer | false | none | none | |
| »»»» action | string | false | none | none | |
| string | false | none | none | ||
| »»»» name | string | false | none | none | |
| »»» organizations | [string] | true | none | none | |
| »»» orgs | [string] | true | none | none | |
| »»» tenants | [string] | true | none | none | |
| »» share | object | true | none | 共享链接配置信息 | |
| »»» id | integer | true | none | none | |
| »»» hash | string | true | none | none | |
| »»» options | object | true | none | none | |
| »»» objectType | string | true | none | none | |
| »»» objectId | integer | true | none | none | |
| »»» createdBy | integer | true | none | none | |
| »»» createdAt | string | true | none | none | |
| »»» isDelete | boolean | true | none | none | |
| »»» title | string | true | none | none | |
| »»» enable | boolean | true | none | none | |
| »» isPlatformData | boolean | true | none | 是否为平台数据 | |
| » chartDataStartTimeMillis | integer | true | none | none | 
1.10. 1.10. PUT 修改填报模设置
PUT /api/surveys/{id}/setting
修改填报模板额外设置信息。
Body 请求参数
{
  "status": "OPEN",
  "allowUsers": {
    "grantors": [
      {
        "id": 17,
        "action": "read",
        "email": "jyuser@qq.com",
        "name": "jyuser"
      }
    ],
    "organizations": [],
    "orgs": [],
    "tenants": []
  }
}
1.10.1. 1.10.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | integer | 是 | none | 
| body | body | object | 否 | none | 
| » allowUsers | body | object | 否 | 允许填报的用户配置信息 | 
| »» grantors | body | [object] | 是 | none | 
| »»» id | body | integer | 否 | none | 
| »»» name | body | string | 否 | none | 
| »»» action | body | string | 否 | none | 
| body | string | 否 | none | |
| »» organizations | body | [string] | 是 | none | 
| »» orgs | body | [string] | 是 | none | 
| »» tenants | body | [string] | 是 | none | 
| » status | body | string | 否 | 填报开启状态 | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": {
    "id": 29,
    "status": "OPEN",
    "allowUsers": {
      "grantors": [
        {
          "id": 17,
          "action": "read",
          "email": "jyuser@qq.com",
          "name": "jyuser"
        }
      ],
      "organizations": [],
      "orgs": [],
      "tenants": []
    }
  },
  "chartDataStartTimeMillis": 0
}
1.10.2. 1.10.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.10.3. 1.10.3. 返回数据结构
1.11. 1.11. PUT 开启共享链接
PUT /api/shares/switch
Body 请求参数
{
  "enable": true,
  "objectId": 0,
  "objectType": "string"
}
1.11.1. 1.11.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| X-CSRF-Token | header | string | 是 | none | 
| Cookie | header | string | 是 | none | 
| body | body | object | 否 | none | 
| » enable | body | boolean | 是 | none | 
| » objectId | body | integer | 是 | none | 
| » objectType | body | string | 是 | none | 
返回示例
200 Response
{}
1.11.2. 1.11.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.11.3. 1.11.3. 返回数据结构
1.12. 1.12. POST 创建填报模板副本
POST /api/surveys/{id}/duplicate
使用提供的标题创建指定模板的副本
1.12.1. 1.12.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| newTitle | query | string | 是 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": {
    "id": 32,
    "title": "创建一个副本试试",
    "formTitle": "一个表单",
    "status": "CLOSED",
    "createdBy": 2,
    "createdAt": "2023-08-10 18:35:15",
    "updatedBy": 2,
    "updatedAt": "2023-08-10 18:35:15",
    "options": {
      "submitButton": {
        "title": "提交"
      },
      "resetButton": {
        "title": "重制",
        "enable": true
      },
      "canUpdateData": true,
      "canLookupData": true,
      "canImportData": true,
      "version": 4.4
    },
    "controls": [
      {
        "uuid": "01H7FBCSERDZJG59S52TKJTQ7K",
        "inputType": "singleLineText",
        "title": "你叫什么呀",
        "fieldName": "name",
        "required": true,
        "options": {
          "maxLength": 10,
          "placeholder": "输入姓名"
        }
      },
      {
        "uuid": "01H7FBE8TNVNJ0257YSPQMNNJF",
        "inputType": "numberInput",
        "title": "年龄多少",
        "fieldName": "age",
        "required": false,
        "options": {
          "maxValue": 100,
          "minValue": 0,
          "onlyInteger": true,
          "placeholder": "输入数字好吗"
        }
      }
    ]
  },
  "chartDataStartTimeMillis": 0
}
1.12.2. 1.12.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.12.3. 1.12.3. 返回数据结构
1.13. 1.13. PUT 更新填写的数据
PUT /api/surveys/{id}/update
更新历史填写的数据。
Body 请求参数
{
  "01GVM95QGK47SVZWCDJ8SBJWWZ": "xxxxx",
  "01GVMMR5ZAAT8SHYTXQY3MKJDS": "没有手机",
  "01GVMMSXNPQJMRMAQTX8H7VWET": "10212424@qq.com",
  "01GVMMT2YAPQ2FS56GYEMRM0K9": "0745-2110111",
  "uniqueKey": "64ed21f217204bba8d5163076ac56619"
}
1.13.1. 1.13.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| body | body | object | 否 | none | 
| » 01GVMMT2YAPQ2FS56GYEMRM0K9 | body | string | 是 | 普通控件填写内容键值对 | 
| » uniqueKey | body | string | 是 | 当前数据记录的唯一标识(hs_row_id的值) | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "chartDataStartTimeMillis": 0
}
1.13.2. 1.13.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.13.3. 1.13.3. 返回数据结构
1.14. 1.14. DELETE 删除填写的数据
DELETE /api/surveys/{id}/delete
删除历史填写的数据。
Body 请求参数
[
  "c435f5029fb940abb20cac9fdb3abfc5",
  "86cd0e76dcd345ccb3f08fc6f39d9783"
]
1.14.1. 1.14.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| Cookie | header | string | 是 | none | 
| X-CSRF-Token | header | string | 是 | none | 
| body | body | array[string] | 否 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "chartDataStartTimeMillis": 0
}
1.14.2. 1.14.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.14.3. 1.14.3. 返回数据结构
1.15. 1.15. POST 根据条件查询填写的表单数据
POST /api/surveys/{id}/query
根据条件查询填写的表单数据。条件以HE的方式传入,具体参考HE部分。
Body 请求参数
{
  "kind": "function",
  "op": "select_fields",
  "args": [
    {
      "kind": "function",
      "op": "filter",
      "args": [
        {
          "kind": "dataset",
          "op": "29"
        },
        {
          "kind": "function",
          "op": "and",
          "args": [
            {
              "kind": "function",
              "op": "!=",
              "args": [
                {
                  "kind": "field",
                  "op": "name",
                  "type": "string",
                  "args": [
                    "[Object]"
                  ]
                },
                {
                  "kind": "constant",
                  "op": "0",
                  "type": "string"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "kind": "field",
      "op": "name",
      "uid": "name"
    },
    {
      "kind": "field",
      "op": "age",
      "uid": "age"
    },
    {
      "kind": "field",
      "op": "hs_updater_id",
      "uid": "hs_updater_id"
    },
    {
      "kind": "field",
      "op": "hs_updater_company",
      "uid": "hs_updater_company"
    },
    {
      "kind": "field",
      "op": "hs_update_time",
      "uid": "hs_update_time"
    },
    {
      "kind": "field",
      "op": "hs_user_id",
      "uid": "hs_user_id"
    },
    {
      "kind": "field",
      "op": "hs_user_company",
      "uid": "hs_user_company"
    },
    {
      "kind": "field",
      "op": "hs_create_time",
      "uid": "hs_create_time"
    },
    {
      "kind": "field",
      "op": "hs_row_id",
      "uid": "hs_row_id"
    }
  ]
}
1.15.1. 1.15.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| offset | query | integer | 否 | none | 
| limit | query | integer | 是 | none | 
| totalRequired | query | string | 否 | none | 
| body | body | object | 否 | none | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 0,
  "msg": "success",
  "data": {
    "data": [
      [
        "你的名字",
        32,
        2,
        null,
        "2023-08-10 17:58:58.000",
        2,
        null,
        "2023-08-10 17:58:58.000",
        "a5048bef2ee54b2bbe83f80f90783a0c"
      ],
      [
        "你的名字",
        32,
        2,
        null,
        "2023-08-10 18:02:09.000",
        2,
        null,
        "2023-08-10 18:02:09.000",
        "c435f5029fb940abb20cac9fdb3abfc5"
      ],
      [
        "as da",
        null,
        2,
        null,
        "2023-08-10 18:05:23.000",
        2,
        null,
        "2023-08-10 18:05:23.000",
        "86cd0e76dcd345ccb3f08fc6f39d9783"
      ]
    ],
    "mapData": [],
    "schema": [
      {
        "fieldName": "name",
        "tags": {},
        "defaultAggrType": "count",
        "basicType": "string",
        "suggestedTypes": [
          "string"
        ],
        "hideValue": false,
        "nativeType": "LONGTEXT",
        "originType": "string",
        "oriName": "01H7FBCSERDZJG59S52TKJTQ7K",
        "visible": true,
        "config": {},
        "type": "string",
        "label": "你叫什么呀",
        "comment": "你叫什么呀"
      },
      {
        "fieldName": "age",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "nativeType": "NUMERIC(65,10)",
        "originType": "number",
        "oriName": "01H7FBE8TNVNJ0257YSPQMNNJF",
        "visible": true,
        "config": {},
        "type": "number",
        "label": "年龄多少",
        "comment": "年龄多少"
      },
      {
        "fieldName": "hs_updater_id",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "originType": "integer",
        "visible": true,
        "config": {},
        "type": "number"
      },
      {
        "fieldName": "hs_updater_company",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "originType": "integer",
        "visible": true,
        "config": {},
        "type": "number"
      },
      {
        "fieldName": "hs_update_time",
        "tags": {},
        "defaultAggrType": "year",
        "basicType": "date",
        "suggestedTypes": [
          "date"
        ],
        "hideValue": false,
        "originType": "time",
        "visible": true,
        "config": {},
        "type": "date"
      },
      {
        "fieldName": "hs_user_id",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "originType": "integer",
        "visible": true,
        "config": {},
        "type": "number"
      },
      {
        "fieldName": "hs_user_company",
        "tags": {},
        "defaultAggrType": "sum",
        "basicType": "number",
        "suggestedTypes": [
          "number"
        ],
        "hideValue": false,
        "originType": "integer",
        "visible": true,
        "config": {},
        "type": "number"
      },
      {
        "fieldName": "hs_create_time",
        "tags": {},
        "defaultAggrType": "year",
        "basicType": "date",
        "suggestedTypes": [
          "date"
        ],
        "hideValue": false,
        "originType": "time",
        "visible": true,
        "config": {},
        "type": "date"
      },
      {
        "fieldName": "hs_row_id",
        "tags": {},
        "defaultAggrType": "count",
        "basicType": "string",
        "suggestedTypes": [
          "string"
        ],
        "hideValue": false,
        "originType": "string",
        "visible": true,
        "config": {},
        "type": "string"
      }
    ],
    "pagable": true,
    "importSwitchable": true,
    "totalHits": 3
  },
  "chartDataStartTimeMillis": 0
}
1.15.2. 1.15.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.15.3. 1.15.3. 返回数据结构
1.16. 1.16. GET 下载模板
GET /api/surveys/{id}/async-download-template
下载填报表单的导入模板。
1.16.1. 1.16.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| withData | query | string | 是 | 是否携带历史填写的数据 | 
返回示例
200 Response
{}
1.16.2. 1.16.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.16.3. 1.16.3. 返回数据结构
1.17. 1.17. POST 导入数据(填报管理员)
POST /api/surveys/{id}/import
批量导入数据的API。该API仅供模板管理员调用(目前仅支持模板创建者调用)。接受xlsx,xls,csv格式文件。
Body 请求参数
file: [ ]
1.17.1. 1.17.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| body | body | object | 否 | none | 
| » file | body | string(binary) | 是 | 要导入的文件 | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 10321,
  "msg": "文件内容存在错误",
  "error": "error/survey-file-content-contains-error",
  "data": {
    "fileInfo": {
      "fileId": "94",
      "type": "file_excel",
      "sheetList": [],
      "originalFilename": "新建一个演示一下 2023-08-10 18-59-08.xlsx",
      "fileExtension": ".xlsx"
    }
  },
  "chartDataStartTimeMillis": 0
}
400 Response
{
  "version": "string",
  "code": 0,
  "msg": "string",
  "error": "string",
  "data": {
    "fileInfo": {
      "fileId": "string",
      "type": "string",
      "sheetList": [
        "string"
      ],
      "originalFilename": "string",
      "fileExtension": "string"
    }
  },
  "chartDataStartTimeMillis": 0
}
1.17.2. 1.17.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
| 400 | Bad Request | 文件内容存在错误 | Inline | 
1.17.3. 1.17.3. 返回数据结构
状态码 400
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 | 
|---|---|---|---|---|---|
| » version | string | true | none | none | |
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » error | string | true | none | none | |
| » data | object | true | none | none | |
| »» fileInfo | object | true | none | 文件信息 | |
| »»» fileId | string | true | none | 文件id | |
| »»» type | string | true | none | 文件类型 | |
| »»» sheetList | [string] | true | none | none | |
| »»» originalFilename | string | true | none | 原始文件名 | |
| »»» fileExtension | string | true | none | 文件扩展名 | |
| » chartDataStartTimeMillis | integer | true | none | none | 
1.18. 1.18. GET 获取导入数据失败的错误提示文件(填报管理员)
GET /api/surveys/{id}/async-download-import-error
当批量导入数据失败时,可使用该API获取导入过程中出现的与填写的数据有关的错误。该API仅供模板管理员调用。(目前仅支持模板创建者调用)
Body 请求参数
{ }
1.18.1. 1.18.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| fileId | query | string | 是 | 文件id(导入API返回的文件id) | 
| originType | query | string | 是 | 原始文件类型 | 
| requestId | query | string | 是 | 请求id | 
| body | body | object | 否 | none | 
返回示例
200 Response
{}
1.18.2. 1.18.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.18.3. 1.18.3. 返回数据结构
1.19. 1.19. GET 异步请求下载文件
GET /api/surveys/{id}/poll-download
根据requestId下载异步导出的文件。
Body 请求参数
{ }
1.19.1. 1.19.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | 填报模板id | 
| originRequestId | query | string | 是 | 发起导出/下载请求的请求id | 
| body | body | object | 否 | none | 
返回示例
200 Response
{}
1.19.2. 1.19.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.19.3. 1.19.3. 返回数据结构
1.20. 1.20. GET 租户查询平台授权模板列表
GET /api/surveys/platform
租户方查询平台方授权给自己的填报模板列表。
返回示例
200 Response
{}
1.20.1. 1.20.1. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.20.2. 1.20.2. 返回数据结构
1.21. 1.21. POST 导出数据(填报管理员)
POST /api/surveys/29/async-download-data
提供给填报管理员导出数据的API,该API仅对填报模板有管理权限的用户能够调用(目前仅支持填报模板的创建者调用)。可提供HE表达式对要进行导出的数据进行过滤。
Body 请求参数
{
  "kind": "function",
  "op": "select_fields",
  "args": [
    {
      "kind": "function",
      "op": "filter",
      "args": [
        {
          "kind": "dataset",
          "op": "29"
        },
        {
          "kind": "function",
          "op": "and",
          "args": [
            {
              "kind": "function",
              "op": "!=",
              "args": [
                {
                  "kind": "field",
                  "op": "name",
                  "type": "string",
                  "args": [
                    "[Object]"
                  ]
                },
                {
                  "kind": "constant",
                  "op": "123",
                  "type": "string"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "kind": "field",
      "op": "name",
      "uid": "name"
    },
    {
      "kind": "field",
      "op": "age",
      "uid": "age"
    },
    {
      "kind": "field",
      "op": "hs_updater_id",
      "uid": "hs_updater_id"
    },
    {
      "kind": "field",
      "op": "hs_updater_company",
      "uid": "hs_updater_company"
    },
    {
      "kind": "field",
      "op": "hs_update_time",
      "uid": "hs_update_time"
    },
    {
      "kind": "field",
      "op": "hs_user_id",
      "uid": "hs_user_id"
    },
    {
      "kind": "field",
      "op": "hs_user_company",
      "uid": "hs_user_company"
    },
    {
      "kind": "field",
      "op": "hs_create_time",
      "uid": "hs_create_time"
    },
    {
      "kind": "field",
      "op": "hs_row_id",
      "uid": "hs_row_id"
    }
  ]
}
1.21.1. 1.21.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| timeout | query | integer | 否 | 等待超时时间(单位毫秒)。当设置该参数时,接口将会等待指定时间再返回,如果在指定时间内没有成功导出,需要使用异步请求下载文件接口进行尝试获取导出文件。 | 
| requestId | query | string | 是 | 当前请求的id | 
| body | body | object | 否 | none | 
返回示例
200 Response
{}
1.21.2. 1.21.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
1.21.3. 1.21.3. 返回数据结构
1.22. 1.22. POST 导入数据
POST /api/surveys/{id}/submit-file
批量导入数据的API。接受xlsx,xls,csv格式文件。
Body 请求参数
file: [ ]
1.22.1. 1.22.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| body | body | object | 否 | none | 
| » file | body | string(binary) | 是 | 要导入的文件 | 
返回示例
成功
{
  "version": "4.5-SNAPSHOT@@git.commit.id.abbrev@#c77fef1",
  "code": 10321,
  "msg": "文件内容存在错误",
  "error": "error/survey-file-content-contains-error",
  "data": {
    "fileInfo": {
      "fileId": "94",
      "type": "file_excel",
      "sheetList": [],
      "originalFilename": "新建一个演示一下 2023-08-10 18-59-08.xlsx",
      "fileExtension": ".xlsx"
    }
  },
  "chartDataStartTimeMillis": 0
}
400 Response
{
  "version": "string",
  "code": 0,
  "msg": "string",
  "error": "string",
  "data": {
    "fileInfo": {
      "fileId": "string",
      "type": "string",
      "sheetList": [
        "string"
      ],
      "originalFilename": "string",
      "fileExtension": "string"
    }
  },
  "chartDataStartTimeMillis": 0
}
1.22.2. 1.22.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline | 
| 400 | Bad Request | 文件内容存在错误 | Inline | 
1.22.3. 1.22.3. 返回数据结构
状态码 400
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 | 
|---|---|---|---|---|---|
| » version | string | true | none | none | |
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » error | string | true | none | none | |
| » data | object | true | none | none | |
| »» fileInfo | object | true | none | 文件信息 | |
| »»» fileId | string | true | none | 文件id | |
| »»» type | string | true | none | 文件类型 | |
| »»» sheetList | [string] | true | none | none | |
| »»» originalFilename | string | true | none | 原始文件名 | |
| »»» fileExtension | string | true | none | 文件扩展名 | |
| » chartDataStartTimeMillis | integer | true | none | none | 
1.23. 1.23. GET 获取导入数据失败的错误提示文件
GET /api/surveys/{id}/async-download-submit-error
当批量导入数据失败时,可使用该API获取导入过程中出现的与填写的数据有关的错误。
Body 请求参数
{ }
1.23.1. 1.23.1. 请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 | 
|---|---|---|---|---|
| id | path | string | 是 | none | 
| fileId | query | string | 是 | 文件id(导入API返回的文件id) | 
| originType | query | string | 是 | 原始文件类型 | 
| requestId | query | string | 是 | 请求id | 
| body | body | object | 否 | none | 
返回示例
200 Response
{}
1.23.2. 1.23.2. 返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 | 
|---|---|---|---|
| 200 | OK | 成功 | Inline |