主题
数据填报
接口说明
获取填写的表单数据
http
GET /api/surveys/{id}/data HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
获取填写的表单数据,仅表单所有者有权限进行查看。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
offset | query | integer | 否 | none |
limit | query | integer | 否 | none |
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
获取填报模板列表
http
GET /api/surveys HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
返回包含简单填报模板信息的列表。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
title | query | string | 否 | 填报模板名字 |
orderBy | query | string | 否 | none |
orderType | query | string | 否 | none |
offset | query | integer | 否 | none |
limit | query | integer | 否 | none |
返回示例
http
HTTP/1.1 200 OK
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
创建填报模板
创建数据填报模板。
http
POST /api/surveys HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
"title": "string"
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
body | body | object | 否 | none |
» title | body | string | 是 | none |
返回示例
http
HTTP/1.1 200 OK
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
返回数据结构
状态码 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 |
根据ID查询模板模板
http
GET /api/surveys/{id} HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
根据id查询数据填报模板的详细信息。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
返回数据结构
状态码 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 |
更新填报模板
更新填报模板信息。
http
PUT /api/surveys/{id} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request 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": "输入数字好吗"
}
}
]
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
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 | 否 | 填报表单名称 |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
删除填报模板
http
DELETE /api/surveys/{id} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
删除指定的数据填报模板。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"code": 0,
"msg": "success",
"chartDataStartTimeMillis": 0
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
获取填报表单信息
http
GET /api/surveys/{id}/submit HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
返回填报表单配置。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | integer | 是 | none |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
填写表单
提交填写的表单内容。以一组控件id与填写内容的键值对为RequestBody。
http
POST /api/surveys/{id}/submit HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
"01H7FBCSERDZJG59S52TKJTQ7K": "你的名字",
"01H7FBE8TNVNJ0257YSPQMNNJF": 32
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | integer | 是 | none |
body | body | object | 否 | none |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"code": 0,
"msg": "success",
"chartDataStartTimeMillis": 0
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
获取填报模板设置
http
GET /api/surveys/{id}/setting HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
获取填报模板的额外配置设置信息。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | integer | 是 | none |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
返回数据结构
状态码 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 |
修改填报模设置
修改填报模板额外设置信息。
http
PUT /api/surveys/{id}/setting HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
"status": "OPEN",
"allowUsers": {
"grantors": [
{
"id": 17,
"action": "read",
"email": "jyuser@qq.com",
"name": "jyuser"
}
],
"organizations": [],
"orgs": [],
"tenants": []
}
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
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 | 否 | 填报开启状态 |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
开启共享链接
http
PUT /api/shares/switch HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
"enable": true,
"objectId": 0,
"objectType": "string"
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
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 | OK | 成功 | Inline |
创建填报模板副本
http
POST /api/surveys/{id}/duplicate HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
使用提供的标题创建指定模板的副本
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
newTitle | query | string | 是 | none |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
更新填写的数据
更新历史填写的数据。
http
PUT /api/surveys/{id}/update HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
{
"01GVM95QGK47SVZWCDJ8SBJWWZ": "xxxxx",
"01GVMMR5ZAAT8SHYTXQY3MKJDS": "没有手机",
"01GVMMSXNPQJMRMAQTX8H7VWET": "10212424@qq.com",
"01GVMMT2YAPQ2FS56GYEMRM0K9": "0745-2110111",
"uniqueKey": "64ed21f217204bba8d5163076ac56619"
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
body | body | object | 否 | none |
» 01GVMMT2YAPQ2FS56GYEMRM0K9 | body | string | 是 | 普通控件填写内容键值对 |
» uniqueKey | body | string | 是 | 当前数据记录的唯一标识(hs_row_id的值) |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"code": 0,
"msg": "success",
"chartDataStartTimeMillis": 0
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
删除填写的数据
删除历史填写的数据。
http
DELETE /api/surveys/{id}/delete HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request Body:
[
"c435f5029fb940abb20cac9fdb3abfc5",
"86cd0e76dcd345ccb3f08fc6f39d9783"
]
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
Cookie | header | string | 是 | none |
X-CSRF-Token | header | string | 是 | none |
body | body | array[string] | 否 | none |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"code": 0,
"msg": "success",
"chartDataStartTimeMillis": 0
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
根据条件查询填写的表单数据
根据条件查询填写的表单数据。条件以HE的方式传入,具体参考HE部分。
http
POST /api/surveys/{id}/query HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request 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"
}
]
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
offset | query | integer | 否 | none |
limit | query | integer | 是 | none |
totalRequired | query | string | 否 | none |
body | body | object | 否 | none |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
下载模板
http
GET /api/surveys/{id}/async-download-template HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
下载填报表单的导入模板。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
withData | query | string | 是 | 是否携带历史填写的数据 |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
导入数据(填报管理员)
批量导入数据的API。该API仅供模板管理员调用(目前仅支持模板创建者调用)。接受xlsx,xls,csv格式文件。
http
POST /api/surveys/{id}/import HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryK1u6TkSMwt8ok9vT
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
file:
------WebKitFormBoundaryK1u6TkSMwt8ok9vT
Content-Disposition: form-data; name="file"; filename="test.csv"
Content-Type: text/csv
------WebKitFormBoundaryK1u6TkSMwt8ok9vT--
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
body | body | object | 否 | none |
» file | body | string(binary) | 是 | 要导入的文件 |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "string",
"code": 0,
"msg": "string",
"error": "string",
"data": {
"fileInfo": {
"fileId": "string",
"type": "string",
"sheetList": [
"string"
],
"originalFilename": "string",
"fileExtension": "string"
}
},
"chartDataStartTimeMillis": 0
}
http
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
400 | Bad Request | 文件内容存在错误 | Inline |
返回数据结构
状态码 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 |
获取导入数据失败的错误提示文件(填报管理员)
http
GET /api/surveys/{id}/async-download-import-error HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
当批量导入数据失败时,可使用该API获取导入过程中出现的与填写的数据有关的错误。该API仅供模板管理员调用。(目前仅支持模板创建者调用)
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
fileId | query | string | 是 | 文件id(导入API返回的文件id) |
originType | query | string | 是 | 原始文件类型 |
requestId | query | string | 是 | 请求id |
body | body | object | 否 | none |
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
异步请求下载文件
http
GET /api/surveys/{id}/poll-download HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
根据requestId下载异步导出的文件。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | 填报模板id |
originRequestId | query | string | 是 | 发起导出/下载请求的请求id |
body | body | object | 否 | none |
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
租户查询平台授权模板列表
http
GET /api/surveys/platform HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
租户方查询平台方授权给自己的填报模板列表。
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
导出数据(填报管理员)
提供给填报管理员导出数据的API,该API仅对填报模板有管理权限的用户能够调用(目前仅支持填报模板的创建者调用)。可提供HE表达式对要进行导出的数据进行过滤。
http
POST /api/surveys/29/async-download-data HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
// Request 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"
}
]
}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
timeout | query | integer | 否 | 等待超时时间(单位毫秒)。当设置该参数时,接口将会等待指定时间再返回,如果在指定时间内没有成功导出,需要使用异步请求下载文件接口进行尝试获取导出文件。 |
requestId | query | string | 是 | 当前请求的id |
body | body | object | 否 | none |
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
导入数据
批量导入数据的API。接受xlsx,xls,csv格式文件。
http
POST /api/surveys/{id}/submit-file HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryK1u6TkSMwt8ok9vT
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
file:
------WebKitFormBoundaryK1u6TkSMwt8ok9vT
Content-Disposition: form-data; name="file"; filename="小数.csv"
Content-Type: text/csv
------WebKitFormBoundaryK1u6TkSMwt8ok9vT--
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
body | body | object | 否 | none |
» file | body | string(binary) | 是 | 要导入的文件 |
返回示例
http
HTTP/1.1 200 Ok
Content-Type: application/json
{
"version": "string",
"code": 0,
"msg": "string",
"error": "string",
"data": {
"fileInfo": {
"fileId": "string",
"type": "string",
"sheetList": [
"string"
],
"originalFilename": "string",
"fileExtension": "string"
}
},
"chartDataStartTimeMillis": 0
}
http
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"version": "version@9a5e106#6730f0d",
"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
}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
400 | Bad Request | 文件内容存在错误 | Inline |
返回数据结构
状态码 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 |
获取导入数据失败的错误提示文件
http
GET /api/surveys/{id}/async-download-submit-error HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...
当批量导入数据失败时,可使用该API获取导入过程中出现的与填写的数据有关的错误。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | none |
fileId | query | string | 是 | 文件id(导入API返回的文件id) |
originType | query | string | 是 | 原始文件类型 |
requestId | query | string | 是 | 请求id |
body | body | object | 否 | none |
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |