跳到主要内容
版本:1.3.0

服务端API

默认返回结构

名称含义类型
code成功:200、失败:500、未登录:403Number
data问卷列表数据Content
msg错误提示信息String

问卷状态

NEW = 'new', // 新建
EDITING = 'editing', // 编辑
PAUSING = 'pausing', // 暂停
PUBLISHED = 'published', // 发布
REMOVED = 'removed', // 删除
FORCE_REMOVED = 'forceRemoved', // 从回收站删除

问卷基础管理

创建问卷

用于创建问卷

POST /api/survey/createSurvey

Request

名称含义类型是否必填默认值
surveyType问卷类型StringY
title问卷标题StringY
remark问卷描述StringY
createMethod创建方式StringY
createFrom创建来源StringY

请求示例

{
"surveyType": "normal",
"title": "问卷",
"remark": "",
"loginLimitType": "unlimited",
"loginType": ""
}

返回示例

{
"success": true,
"data": {
"id": "64c8bde289e41908d8898d13"
}
}

获取问卷列表

获取问卷列表

GET /api/survey/getList

Request

名称含义类型是否必填默认值
pageSize每次获取数据numberY
curPage当前页码,从 1 开始numberY
filter筛选条件FilterItem[]N
order排序条件OrderItem[]N
workspaceId新建的空间 idstringY

FilterItem

名称含义类型是否必填默认值
comparator条件之间的关系,$or:或者,默认合并条件进行查询stringN
condition筛选条件FilterConditionY

FilterCondition

名称含义类型是否必填默认值
field筛选字段,title:搜索问卷名、 curStatus.status:筛选问卷状态、surveyType:问卷类型stringY
comparator比较符,$ne$regex:匹配问卷 titlestringN
value筛选/搜索条件stringY

OrderItem

名称含义类型是否必填默认值
field字段名stringY
value升序降序, -1、1numberY

请求示例

{
"pageSize": 10,
"curPage": 1,
"filter": [
{
"comparator": "",
"condition": [
{
"field": "title",
"value": "问卷1",
"comparator": "$regex"
}
]
},
{
"comparator": "",
"condition": [
{
"field": "curStatus.status",
"value": "published"
}
]
},
{
"comparator": "",
"condition": [
{
"field": "surveyType",
"value": "normal"
}
]
}
],
"order": [
{
"field": "createDate",
"value": 1
}
],
"workspaceId": ""
}

返回示例

{
"success": true,
"data": {
"data": [
{
"_id": "64c8bde289e41908d8898d13",
"name": "测试名字",
"surveyType": "normal",
"title": "问卷",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690878454080
},
"createDate": 1690877410380,
"creator": "test",
"owner": "test"
},
{
"_id": "64c21f84c553d5f8ca9f364f",
"name": "",
"surveyType": "normal",
"title": "问卷",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690443652253
},
"createDate": 1690443652253,
"creator": "test",
"owner": "test"
}
],
"count": 2
}
}

修改问卷

用于修改问卷

POST /api/survey/updateMeta

Request

名称含义类型是否必填默认值
surveyId问卷 IDstringY
title问卷标题stringY
remark问卷描述stringY

请求示例

{
"surveyId": "64c8bde289e41908d8898d13",
"title": "问卷标题",
"remark": "问卷描述"
}

删除问卷

用于删除问卷

POST /api/survey/deleteSurvey

Request

名称含义类型是否必填默认值
surveyId问卷 IDstringY

请求示例

{
"surveyId": "64c8bde289e41908d8898d13"
}

返回示例

{
"success": true,
"data": {
"surveyMetaDeleteRes": {
"acknowledged": true,
"deletedCount": 0
}
}
}

问卷编辑管理

获取问卷配置

用于获取问卷配置

GET /api/survey/getSurvey

Request

名称含义类型是否必填默认值
surveyId问卷 IDstringY

请求示例

/api/survey/getSurvey?surveyId=64c8bde289e41908d8898d13

返回示例

{
"success": true,
"data": {
"surveyMetaRes": {
"_id": "64c8bde289e41908d8898d13",
"name": "测试名字",
"surveyType": "normal",
"title": "问卷",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877410380
},
"createDate": 1690877410380
},
"surveyConfRes": {
"_id": "64c8bde289e41908d8898d14",
"pageId": "64c8bde289e41908d8898d13",
"pageType": "normal",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877410471
},
"code": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"passwordSwitch": true,
"password": "xxx",
"whitelistType": "CUSTOM",
"memberType": "MOBILE",
"whitelist": ["xxx"],
"whitelistTip": "xxx"
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
}
}
}

获取 Banner 配置

用于获取问卷配置

GET /api/survey/getBannerData

Request

名称含义类型是否必填默认值

请求示例

GET /api/survey/getBannerData

返回示例

{
"code": 200,
"data": {
"temp": {
"key": "default",
"name": "默认分类",
"list": [
{
"src": "/imgs/skin/nUc1h8MM0y1582635399432.png",
"title": "1"
},
{
"src": "/imgs/skin/EqcneDJ8xI1582635403367.png",
"title": "2"
}
]
},
"activity": {
"key": "activity",
"name": "节日",
"list": [
{
"src": "/imgs/skin/Ixx8hqiwwk1660979120801.jpg",
"title": "1"
},
{
"src": "/imgs/skin/q2eDZjSLnB1660978085149.jpg",
"title": "2"
},
{
"src": "/imgs/skin/bTemK3oa0z1660978085209.jpg",
"title": "3"
},
{
"src": "/imgs/skin/ObQBPJqViY1660978085693.jpg",
"title": "4"
}
]
},
"creative": {
"key": "creative",
"name": "创意",
"list": [
{
"src": "/imgs/skin/PLwNH1rAie1558430219772.jpg",
"title": "1"
},
{
"src": "/imgs/skin/NnXsAOhBNm1558430219312.jpg",
"title": "2"
},
{
"src": "/imgs/skin/ujpUoWqhw31558430220124.jpg",
"title": "3"
},
{
"src": "/imgs/skin/5OCvbjqJQm1558430220362.jpg",
"title": "4"
},
{
"src": "/imgs/skin/0k7Jg7In8I1558430221154.jpg",
"title": "5"
},
{
"src": "/imgs/skin/UH0A8DbTai1558430221033.jpg",
"title": "6"
},
{
"src": "/imgs/skin/FRIzPC6ZtN1558430221344.jpg",
"title": "7"
}
]
},
"scenery": {
"key": "scenery",
"name": "风景",
"list": [
{
"src": "/imgs/skin/SyiLRcukyE1558430525760.jpg",
"title": "1"
},
{
"src": "/imgs/skin/sqYig4AcWr1558430525663.jpg",
"title": "2"
},
{
"src": "/imgs/skin/ElNeqJT2I21558430526165.jpg",
"title": "3"
},
{
"src": "/imgs/skin/CxQkSU6AY21558430526163.jpg",
"title": "4"
},
{
"src": "/imgs/skin/VTUwbp6vY61558430527320.jpg",
"title": "5"
},
{
"src": "/imgs/skin/SHs0K703Yn1558430527218.jpg",
"title": "6"
},
{
"src": "/imgs/skin/oVTedX9V4s1558430527671.jpg",
"title": "7"
}
]
},
"transportation": {
"key": "transportation",
"name": "交通",
"list": [
{
"src": "/imgs/skin/XYKqJZuMig1558430904735.jpg",
"title": "1"
},
{
"src": "/imgs/skin/GnPatsr48Z1558430904680.jpg",
"title": "2"
},
{
"src": "/imgs/skin/UqIvVvEXAK1558430905204.jpg",
"title": "3"
},
{
"src": "/imgs/skin/PUssufh5uI1558430905104.jpg",
"title": "4"
},
{
"src": "/imgs/skin/O409pRTDlW1558430905738.jpg",
"title": "5"
},
{
"src": "/imgs/skin/A9FzlbYXqI1558430905739.jpg",
"title": "6"
},
{
"src": "/imgs/skin/HN9YGctDeF1558430906686.jpg",
"title": "7"
}
]
},
"delicacy": {
"key": "delicacy",
"name": "美食",
"list": [
{
"src": "/imgs/skin/lE6PSclCcU1558434536703.jpg",
"title": "1"
},
{
"src": "/imgs/skin/OnSdbm7u6n1558434536641.jpg",
"title": "2"
},
{
"src": "/imgs/skin/N9Z2ZuyO731558434537314.jpg",
"title": "3"
},
{
"src": "/imgs/skin/YP9PoW8pX51558434537301.jpg",
"title": "4"
},
{
"src": "/imgs/skin/zUtDv378bg1558434538351.jpg",
"title": "5"
},
{
"src": "/imgs/skin/gY1JljCow21558434538303.jpg",
"title": "6"
},
{
"src": "/imgs/skin/oOjHPbABdd1558434538864.jpg",
"title": "7"
}
]
},
"business": {
"key": "business",
"name": "商务",
"list": [
{
"src": "/imgs/skin/3ABKqvDaVn1558514860472.jpg",
"title": "1"
},
{
"src": "/imgs/skin/OewuaQmWoq1558514860285.jpg",
"title": "2"
},
{
"src": "/imgs/skin/HuVqqtbFjs1558514860570.jpg",
"title": "3"
},
{
"src": "/imgs/skin/icSlqsr0uZ1558514860875.jpg",
"title": "4"
},
{
"src": "/imgs/skin/Qu9rg33wmq1558514861015.jpg",
"title": "5"
},
{
"src": "/imgs/skin/145gBCRtNP1558514861211.jpg",
"title": "6"
},
{
"src": "/imgs/skin/ykWLFV0QWj1558514861444.jpg",
"title": "7"
}
]
},
"campus": {
"key": "campus",
"name": "校园",
"list": [
{
"src": "/imgs/skin/4aWi5JxG471558514268698.jpg",
"title": "1"
},
{
"src": "/imgs/skin/j8C2OBP7WK1558514268563.jpg",
"title": "2"
},
{
"src": "/imgs/skin/q3uJoQhYsR1558514268877.jpg",
"title": "3"
},
{
"src": "/imgs/skin/W5PPlNsmsr1558514269088.jpg",
"title": "4"
},
{
"src": "/imgs/skin/6xQk1IAmKt1558514269874.jpg",
"title": "5"
},
{
"src": "/imgs/skin/XQE2iyF0rj1558514269935.jpg",
"title": "6"
},
{
"src": "/imgs/skin/POHlQiSwPR1558514270379.jpg",
"title": "7"
}
]
}
}
}

获取历史数据

用于获取问卷配置

GET /api/surveyHistory/getList

Request

名称含义类型是否必填默认值
surveyId问卷 IDstringY
historyType历史数据类别stringYdailyHis 日常保存历史; publishHis 发布历史

请求示例

/api/surveyHistory/getList?surveyId=64c8bde289e41908d8898d13&historyType=dailyHis

返回示例

{
"success": true,
"data": [
{
"_id": "64c8c001e593703b0f458074",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877953435
},
"pageId": "64c8bde289e41908d8898d13",
"type": "dailyHis",
"code": {
"data": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">2欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"formdataBackfill": "notallow",
"previousSwitch": "notallow",
"showVoteProcess": "allow",
"publishDate": 1527647912221
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
},
"createDate": 1690877953435
},
{
"_id": "64c8bfeee593703b0f458073",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877934313
},
"pageId": "64c8bde289e41908d8898d13",
"type": "dailyHis",
"code": {
"data": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"formdataBackfill": "notallow",
"previousSwitch": "notallow",
"showVoteProcess": "allow",
"publishDate": 1527647912221
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
},
"createDate": 1690877934313,
"operator": {
"_id": "64c8ccd1eb145f835dce08fa",
"username": "test"
}
}
]
}

记录编辑窗口

用于编辑冲突检测

POST /api/session/create

Request

名称含义类型是否必填默认值
surveyId问卷 IDStringY

Response

字段含义类型必填
sessionId问卷编辑窗口会话 idnumberY

获取问卷编辑权限

用于编辑冲突检测

POST /api/session/seize

Request

名称含义类型是否必填默认值
sessionId问卷编辑窗口会话 idnumberY

Response

字段含义类型必填
sessionId问卷编辑窗口会话 idnumberY

保存问卷

用于保存问卷

POST /api/surveyConf/updateConf

Request

名称含义类型是否必填默认值
surveyId问卷 IDStringY
sessionId问卷编辑会话 IDObjectY
configData问卷数据ObjectY

请求示例

{
"surveyId": "64c8bde289e41908d8898d13",
"sessionId": "66f0e7ad90207bca808aa178",
"configData": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">2欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"formdataBackfill": "notallow",
"previousSwitch": "notallow",
"showVoteProcess": "allow",
"publishDate": 1527647912221
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
}

返回示例

{
"success": true,
"msg": ""
}

发布问卷

用于发布问卷

POST /api/survey/publishSurvey

Request

名称含义类型是否必填默认值
surveyId问卷 IDstringY

请求示例

{
"surveyId": "64c8bde289e41908d8898d13"
}

返回示例

{
"success": true,
"data": {
"updateMetaRes": {
"acknowledged": true,
"modifiedCount": 1,
"upsertedId": null,
"upsertedCount": 0,
"matchedCount": 1
},
"insertPublishRes": {
"acknowledged": true,
"insertedId": {}
},
"historyRes": {
"acknowledged": true,
"insertedId": {}
}
}
}

C 端接口

获取已发布问卷 schema

获取发布后的问卷数据 schema

get /api/responseSchema/getSchema

Request

名称含义类型是否必填默认值
surveyPath问卷短 IDStringY

请求示例

/api/responseSchema/getSchema?surveyPath=9VBpGNQi

返回示例

{
"success": true,
"data": {
"surveyMetaRes": {
"_id": "64c8bde289e41908d8898d13",
"name": "测试名字",
"surveyType": "normal",
"title": "问卷",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690878454080
},
"createDate": 1690877410380
},
"surveyPublishRes": {
"_id": "64c8bde289e41908d8898d14",
"pageId": "64c8bde289e41908d8898d13",
"pageType": "normal",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690877410471
},
"code": {
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">2欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"applyTitle": "让我们开始吧",
"subTitle": ""
},
"bannerConfig": {
"bgImage": "",
"videoLink": "",
"postImg": ""
},
"ruleConfig": {
"isShow": "",
"title": "问卷规则 》",
"ruleBottom": "0.5",
"color": "666666",
"content": ""
}
},
"scoreConf": {
"off": "",
"scoreShow": "",
"totalShow": "",
"random": "",
"showResult": "",
"allRight": "",
"ranNumber": "",
"totalScore": 0,
"scoreRange": [
{
"start": "",
"end": "",
"text": ""
}
]
},
"submitConf": {
"submitTitle": "提交",
"confirmAgain": {
"is_again": true,
"again_text": "确认要提交吗?"
},
"msgContent": {
"msg_200": "提交成功",
"msg_9001": "您来晚了,感谢支持问卷~",
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
},
"buttonList": [
{
"title": "",
"url": ""
}
],
"link": ""
},
"bottomConf": {
"bannerImage": "",
"bannerImageWidth": "100%",
"logoChoose": "didi",
"logoImage": "",
"logoImageWidth": "33%"
},
"baseConf": {
"begTime": "2018-05-22 17:17:48",
"endTime": "2028-05-22 17:17:48",
"viewType": "block",
"tLimit": "0",
"qEquipLimit": "0",
"qIpLimit": "0",
"loginLimit": {
"type": "",
"limit": "0"
},
"language": "chinese",
"formdataBackfill": "notallow",
"previousSwitch": "notallow",
"showVoteProcess": "allow",
"publishDate": 1527647912221
},
"skinConf": {
"skinColor": "#4a4c5b",
"inputBgColor": "ffffff"
},
"shareConf": {
"shareConfig": {
"shareTitle": "",
"shareDesc": "",
"shareImg": "",
"shareLink": ""
}
},
"dataConf": {
"dataList": [
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "text",
"field": "data458",
"title": "标题1",
"titleRich": "标题1",
"placeholder": "",
"sLimit": 1,
"mobKey": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"cOption": "",
"cOptions": [],
"score": 0,
"maxPhotos": 5,
"star": 5,
"timeStep": {
"hour": 1,
"min": 10
},
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"exclude": false,
"relTypes": {
"textarea": "多行文本框",
"text": "单行输入框"
},
"placeholderDesc": "",
"carDataType": 1,
"mhLimit": 0,
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
},
{
"isRequired": true,
"showIndex": true,
"showType": true,
"showSpliter": true,
"type": "radio-v",
"relTypes": {
"radio-v": "竖向排列",
"radio-h": "横向排列"
},
"placeholderDesc": "",
"carDataType": 1,
"field": "data515",
"sLimit": 1,
"mhLimit": 0,
"mobKey": "",
"title": "标题2",
"titleRich": "标题2",
"placeholder": "",
"randomSort": false,
"checked": false,
"exam": false,
"minNum": "",
"maxNum": "",
"options": [
{
"text": "选项1",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
},
{
"text": "选项2",
"imageUrl": "",
"others": false,
"mustOthers": false,
"othersKey": "",
"placeholderDesc": "",
"score": 0
}
],
"matrixRadioOpt": {
"titles": [
{
"text": "标题1"
},
{
"text": "标题2"
}
]
},
"importKey": "single",
"importData": "",
"cOption": "",
"cOptions": [],
"score": 0,
"timeStep": {
"hour": 1,
"min": 10
},
"maxPhotos": 5,
"nps": {
"leftText": "极不满意",
"rightText": "极满意"
},
"star": 5,
"exclude": false,
"addressType": 3,
"isAuto": false,
"urlKey": "",
"cascadeData": [
{
"id": 0,
"name": "级联选项内容配置",
"children": [
{
"id": "cascade_0",
"name": "一级选项",
"children": [
{
"id": "cascade_0_0",
"name": "二级选项",
"children": [
{
"id": "cascade_0_0_0",
"name": "三级选项",
"children": []
}
]
}
]
}
]
}
],
"defaultProps": {
"children": "children",
"label": "name",
"id": "id"
},
"relyList": [
{
"relyField": "",
"relyOption": [],
"relyType": "selected"
}
],
"jumpTo": "",
"startDate": "",
"endDate": "",
"othersKeyMap": {}
}
],
"total": 0,
"activeIndex": 1,
"limitMap": {}
}
}
}
}
}

获取选项已选信息

get /api/counter/queryOptionCountInfo

Request

名称含义类型是否必填默认值
surveyPath问卷短 IDStringY
fieldList题目 ID,逗号隔开StringY

请求示例

/api/counter/queryOptionCountInfo?fieldList=data458,data459&surveyPath=9VBpGNQi

返回示例

{
"code": 200,
"data": {
"data458": {
"9584": 2,
"9585": 1,
"total": 5
}
}
}

提交问卷

用于提交问卷

POST /api/surveyResponse/createResponse

Request

名称含义类型是否必填默认值
surveyPath问卷短 IDStringY
data活动数据,如果 encryptType 为 base64 则 data 数据 JSON 化后传 base64 字符串StringY
encryptType加密方式StringN
sign签名StringY
verifyId白名单 IDStringN
whitelist用户输入的值(手机号/邮箱/用户名)StringN
password密码StringN

请求示例

{
"surveyId": "64c8bde289e41908d8898d13",
"data": {
"data458": "11111",
"data515": "E0GZGNDY",
"scores": {},
"optionsWithId": {
"data515": [
{
"id": "E0GZGNDY",
"value": "选项1"
}
]
},
"channel": "",
"p": "",
"diffTime": 14.138,
"secret": ""
},
"sign": "",
"backParams": {},
"cityId": "",
"cityName": "",
"omgh5fp": "a4edc724-b201-4e53-877b-d9b4f134909f",
"isForceSubmit": false,
"memberKey": "",
"businessParams": {},
"clientTime": 1690183745048,
"userInfo": {},
"appName": "Others"
}

返回示例

{
"code": 200,
"success": true
}

白名单验证

POST /api/responseSchema/:surveyPath/validate

Request

字段含义类型是否必填默认值
whitelist用户输入的值(手机号/邮箱/用户名)StringN
password密码StringN

返回示例

{
"code": 200,
"data": {
"result": true,
"verifyId": "xxx"
}
}

数据分析

获取回收数据

获取回收数据

GET /api/survey/dataStatistic/dataTable

Request

名称含义类型是否必填默认值
surveyId问卷 IDstringY
page页码numberN1
isShowSecret[是否展示脱敏的数据]{.mark}booleanNfalse
pageSize页面尺寸numberN10

请求示例

GET /api/survey/dataStatistic/dataTable

返回示例

{
"success": true,
"data": {
"total": 1,
"listHead": [
{
"field": "data458",
"title": "标题1",
"type": "text"
},
{
"field": "data515",
"title": "标题2",
"type": "radio-v"
}
],
"listBody": [
{
"_id": "64ca0a8ee71efa1ace9eb574",
"surveyId": "64c8bde289e41908d8898d13",
"data": {
"data458": "11111",
"data515": "E0GZGNDY",
"scores": {},
"optionsWithId": {
"data515": [
{
"id": "E0GZGNDY",
"value": "选项1"
}
]
},
"channel": "",
"p": "",
"diffTime": 14.138,
"secret": ""
},
"sign": "",
"backParams": {},
"cityId": "",
"cityName": "",
"omgh5fp": "a4edc724-b201-4e53-877b-d9b4f134909f",
"isForceSubmit": false,
"memberKey": "",
"businessParams": {},
"clientTime": 1690183745048,
"userInfo": {},
"appName": "Others",
"pageId": "64c8bde289e41908d8898d13",
"curStatus": {
"status": "new",
"id": "new",
"date": 1690962574622
},
"createDate": 1690962574622
}
]
}
}

分题统计

分题统计

GET /api/survey/dataStatistic/aggregationStatis

Request

名称含义类型是否必填默认值
surveyId问卷 IDstringY

请求示例

GET /api/survey/dataStatistic/aggregationStatis?surveyId=xxx

返回示例

{
"code": 200,
"data": [
{
"field": "data515",
"data": {
"aggregation": [
{
"id": "115019",
"text": "选项1",
"count": 3
},
{
"id": "115020",
"text": "选项2",
"count": 1
}
],
"submitionCount": 4
},
"title": "<p>单选</p>",
"type": "radio"
},
{
"field": "data389",
"data": {
"aggregation": [
{
"id": "140079",
"text": "选项1",
"count": 2
},
{
"id": "657361",
"text": "选项2",
"count": 4
},
{
"id": "029899",
"text": "选项",
"count": 1
}
],
"submitionCount": 4
},
"title": "<p>多选标题</p>",
"type": "checkbox"
},
{
"field": "data551",
"data": {
"aggregation": [
{
"id": "187688",
"text": "对",
"count": 1
},
{
"id": "264793",
"text": "错",
"count": 3
}
],
"submitionCount": 4
},
"title": "<p>判断题</p>",
"type": "binary-choice"
},
{
"field": "data731",
"data": {
"aggregation": [
{
"text": "1",
"id": "1",
"count": 0
},
{
"text": "2",
"id": "2",
"count": 0
},
{
"text": "3",
"id": "3",
"count": 0
},
{
"text": "4",
"id": "4",
"count": 1
},
{
"text": "5",
"id": "5",
"count": 3
}
],
"submitionCount": 4,
"summary": {
"average": "4.75",
"median": "5.00",
"variance": "0.21"
}
},
"title": "<p>评分题</p>",
"type": "radio-star"
},
{
"field": "data249",
"data": {
"aggregation": [
{
"text": "0",
"id": "0",
"count": 0
},
{
"text": "1",
"id": "1",
"count": 0
},
{
"text": "2",
"id": "2",
"count": 0
},
{
"text": "3",
"id": "3",
"count": 0
},
{
"text": "4",
"id": "4",
"count": 0
},
{
"text": "5",
"id": "5",
"count": 0
},
{
"text": "6",
"id": "6",
"count": 0
},
{
"text": "7",
"id": "7",
"count": 0
},
{
"text": "8",
"id": "8",
"count": 1
},
{
"text": "9",
"id": "9",
"count": 1
},
{
"text": "10",
"id": "10",
"count": 2
}
],
"submitionCount": 4,
"summary": {
"average": "9.25",
"median": "9.50",
"variance": "0.73",
"nps": "75.00%"
}
},
"title": "<p>NPS标题</p>",
"type": "radio-nps"
},
{
"field": "data234",
"data": {
"aggregation": [
{
"id": "597844",
"text": "选项1",
"count": 3
},
{
"id": "646556",
"text": "选项2",
"count": 1
}
],
"submitionCount": 4
},
"title": "标题8",
"type": "vote"
}
]
}

Response

字段含义类型必填
data协作人列表Array<QuestionItem>Y

QuestionItem

字段含义类型必填
field题目 idstringY
title题目标题stringY
type类型stringY
data分题数据DataY

Data

字段含义类型必填
submitionCount提交的用户数numberY
aggregation分题数据Array<Aggregation>Y
summary聚合数据Array<Aggregation>Y

Aggregation

字段含义类型必填
id选项的 id 或者评分的分数stringY
text选项的文本或者评分的分数stringY
count选择当前选项的stringY

Summary

字段含义类型必填
average平均分stringY
median中位数stringY
variance方差stringY
nps净推荐值,只有 nps 题才会返回stringN

创建下载任务

创建下载任务

POST /api/downloadTask/createTask

Request

名称含义类型是否必填默认值
surveyId问卷 IDstringY
isMasked是否脱敏booleanNfalse

Response

字段含义类型必填
taskId任务 idstringY

获取下载任务列表

获取下载任务列表

GET /api/downloadTask/getDownloadTaskList

Request

名称含义类型是否必填默认值
pageIndex页码numberN1
pageSize查询数量numberN20

Response

字段含义类型必填
total任务总数numberY
list任务列表ListItemY

ListItem

字段含义类型必填
taskId任务 idstringY
curStatus任务状态Y
filename文件名stringY
url文件链接stringY
fileSize文件大小stringY
createDate任务生成时间stringY

获取单个下载任务

获取单个下载任务

GET /api/downloadTask/getDownloadTask

Request

名称含义类型是否必填默认值
taskId任务 idstringY

Response

字段含义类型必填
surveyId问卷 idstringY
url文件链接stringY
filename文件名stringY
fileSize文件大小stringY

删除单个下载任务

删除单个下载任务

POST /api/downloadTask/deleteDownloadTask

Request

名称含义类型是否必填默认值
taskId任务 idstringY

Response

字段含义类型必填
data是否删除成功,true 表示删除成功booleanY

授权

注册

用于注册用户

POST /api/auth/register

Request

名称含义类型是否必填默认值
username用户名StringY
password密码StringY
captchaId验证码 idStringY
captcha验证码文案StringY

请求示例

{
"username": "test",
"password": "123456",
"captcha": "xhfs",
"captchaId": "65b9e69de8df57de0ff04ced"
}

返回示例

{
"success": true,
"data": {
"username": "xxx",
"token": "xxx"
}
}

登录

登录

POST /api/auth/login

Request

名称含义类型是否必填默认值
username用户名StringY
password密码StringY
captchaId验证码 idStringY
captcha验证码文案StringY

请求示例

{
"username": "test",
"password": "123456",
"captcha": "xhfs",
"captchaId": "65b9e69de8df57de0ff04ced"
}

返回示例

{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGM4Y2NkMWViMTQ1ZjgzNWRjZTA4ZmEiLCJ1c2VybmFtZSI6InRlc3QiLCJpYXQiOjE2OTA4ODE1NzAsImV4cCI6MTY5MDkxMDM3MH0.wnJ_CGLKU5ljSUnocNwk4FkR6cS_5Pe_uMM2yeMYu9I"
}
}

默认 token 有效 8 小时,使用方式放到请求头的 headers 中的 Authorization,如:

Authorization:Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGM4Y2NkMWViMTQ1ZjgzNWRjZTA4ZmEiLCJ1c2VybmFtZSI6InRlc3QiLCJpYXQiOjE2OTA4ODE1NzAsImV4cCI6MTY5MDkxMDM3MH0.wnJ_CGLKU5ljSUnocNwk4FkR6cS_5Pe_uMM2yeMYu9I

密码强度检测

GET /api/password/strength'

Request

字段含义类型是否必填默认值
password密码StringY

Response

字段含义类型默认值
data密码强度StrongorMediumorWeakWeak

获取用户列表

GET /api/user/getUserList?username=xxx

Request

字段含义类型是否必填默认值
username查询的用户名stringY-
pageIndex页码,默认 1numberN1
pageSize每页查询条数,默认 10numberN10

Response

字段含义类型是否必填默认值
data用户列表Array<User>Y[]

User

字段含义类型必填
userId用户 idstringY
username用户名stringY

获取用户信息

GET /api/user/getUserInfo

Request

名称含义类型是否必填默认值

Response

字段含义类型是否必填默认值
userId用户 idstringY
username用户名stringY

空间/协作权限

创建空间

POST /api/workspace

Request

字段含义类型是否必填默认值
name空间名称stringY
description空间描述stringN
members空间成员Array<Member>N

Member

字段含义类型必填
userId用户 idstringY
role用户角色枚举:admin、userstringY

Response

字段含义类型必填
workspaceId新建的空间 idstringY

获取空间列表

获取我参与的空间列表

GET /api/workspace

Request

字段含义类型是否必填默认值
pageSize每次获取数据numberY
curPage当前页码,从 1 开始numberN
name空间名字stringN

Response

字段含义类型必填
list空间列表Array<Workspace>Y

Workspace

字段含义类型必填
_id空间 idstringY
ownerId所有者 idstringY
owner所有者用户名stringY
name空间名称stringY
description空间描述stringY
currentUserId当前用户的 idstringY
currentUserRole当前用户的角色,枚举:admin、userstringY
surveyTotal包含的问卷总数numberY
memberTotal包含的成员总数numberY

获取空间成员列表

GET /api/workspace/member/list

Response

字段含义类型必填
members成员列表Array<Member>Y

Member

字段含义类型必填
_id成员 idstringY
userId用户 idstringY
username用户名stringY
workspaceId空间 IDstringY

获取空间详情

GET /api/workspace/{workspaceId}

Response

字段含义类型必填
_id空间 idstringY
name空间名称stringY
description空间描述stringY
members空间成语啊Array<Member>Y

Member

字段含义类型必填
_id成员 idstringY
userId用户 idstringY
username用户名stringY
role用户角色stringY
currentUserId当前用户的 idstringY
currentUserRole当前用户的角色,枚举:admin、userstringY

更新空间信息

POST /api/workspace/{workspaceId}

Request

字段含义类型必填
name空间名称stringY
description空间描述stringN
members空间成员Array<Member>N

Member

字段含义类型必填
_id成员 id,新添加的不用传stringN
userId用户 idstringY
role用户角色stringY

body 示例

{
"name": "新的空间名称",
"description": "新的空间描述",
"members": [
{
userId: "xxx", "role": "user"
},
{
userId: "xxx", "role": "admin", _id: string
}
]
}

Response

字段含义类型必填
code状态码,200 表示正常numberY

删除空间

DELETE /api/workspace/{workspaceId}

Response

字段含义类型必填
code状态码,200 表示正常numberY

获取所有的协作权限列表

GET /api/collaborator/getPermissionList

Response

字段含义类型必填
data可选权限列表Array<Permission>Y

Permission

字段含义类型必填
name权限说明stringY
value权限标识numberY

批量保存协作人(不区分新增还是更新)

POST /api/collaborator/batchSave

Request

字段含义类型必填
surveyId问卷 idstringY
collaborators协作人列表Array<Collaborator>N

Collaborator

字段含义类型必填
_id成员 id,新添加的不用传stringN
userId用户 idstringY
permissions用户权限,1002,1002,1003Array<number>Y

body 示例

{
"surveyId": "xxx",
"collaborators": [
{
userId: "xxx", "permissions": [1001,1002]
},
{
userId: "xxx", "permissions": [1001,1002] _id: "xxx"
}
]
}

Response

字段含义类型必填
code状态码,200 表示正常numberY

获取问卷的协作人列表

GET /api/collaborator?surveyId=xxx

Query

字段含义类型必填
surveyId问卷 idstringY

Response

字段含义类型必填
data协作人列表Array<Collaborator>Y

Collaborator

字段含义类型必填
_id协作 idstringY
surveyId问卷 idstringY
userId用户 idstringY
username用户名stringY
permissions权限列表,枚举 1001、1002、1003Array<number>Y