修改回答内容
接口概述
- 功能:添加回答内容
- 请求方式: POST
- 请求地址:/api/surveys/{survey_id}/answers/{answer_id}
请求参数
基本参数
| 参数名 | 类型 | 参数位置 | 描述 | 示例值 |
|---|---|---|---|---|
| survey_id | integer | uri | 问卷ID | 292192 |
| answer_id | integer | uri | 回答ID | 1 |
| start_at | integer | body | 回答开始时间 | 1626260840 |
| end_at | integer | body | 回答结束时间 | 1626260841 |
| answer | object | body | 回答内容 | |
| answer.survey_type | integer | body | 问卷类型 | 0普通问卷,1测评问卷 |
| answer.jsonLoadTime | integer | body | 答题总时长(秒) | 10 |
| answer.time | integer | body | 答题结束时间戳 | 1625835392 |
| answer.ua | string | body | 浏览器 user-agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 |
| answer.referrer | string | body | 答题页面的来源地址 | https://wj.qq.com/deliver.html?sid=292194 |
| answer.uid | string | body | 随机生成的用户标识 | 传空字符串即可 |
| answer.sid | string | body | 随机生成的答题标识 | 传空字符串即可 |
| answer.openid | string | body | 自定义字段,从答题页链接的query参数获得,入库后有单独字段保存,支持统计、导出 | abcdefg |
| answer.latitude | string | body | 用户定位坐标维度 | "22.527735929411932" |
| answer.longitude | string | body | 用户定位坐标经度 | "113.93811254994733" |
| answer.is_update | bool | body | 是否修改上次答案,是则数据库不更新数据,仅查找该用户的上一次提交进行修改 | false |
| answer.pages | array[object] | body | 参考添加回答内容 |
请求示例
POST https://open.wj.qq.com/api/surveys/292192/answers/1
{
"start_at": 1626260840,
"end_at": 1626260841,
"answer": {
"id": "292185",
"survey_type": 0,
"jsonLoadTime": 39,
"time": 1625821222,
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36",
"referrer": "https://wj.qq.com/mine.html",
"uid": "391890fe-1256-4b0d-8a14-735e0270702f",
"sid": "a4b759a5-db54-4260-af89-a71e537e21f3",
"openid": "",
"pages": [{
"id": "1",
"questions": [{
"id": "q-1-leFK",
"type": "radio",
"options": [{
"id": "o-100-ABCD",
"checked": 1,
"text": "<p>选项A</p>\n"
}]
}, {
"id": "q-2-hijH",
"type": "select",
"options": [{
"id": "o-100-ABCD",
"checked": 1,
"text": "选项A"
}]
}, {
"id": "q-3-ebel",
"type": "checkbox",
"options": [{
"id": "o-100-ABCD",
"checked": 1,
"text": "<p>选项A</p>\n"
}]
}, {
"id": "q-4-nSBr",
"type": "text",
"text": "123"
}, {
"id": "q-5-oo6i",
"type": "textarea",
"text": "234"
}, {
"id": "q-6-3TOZ",
"type": "star",
"text": "12"
}, {
"id": "q-7-zkcT",
"type": "matrix_radio",
"groups": [{
"id": "g-1-ABCD",
"options": [{
"id": "o-100-ABCD",
"checked": 1,
"text": "<p>选项1</p>\n"
}]
}, {
"id": "g-2-EFGH",
"options": [{
"id": "o-101-EFGH",
"checked": 1,
"text": "<p>选项2</p>\n"
}]
}]
}, {
"id": "q-8-psoY",
"type": "matrix_checkbox",
"groups": [{
"id": "g-1-ABCD",
"options": [{
"id": "o-100-ABCD",
"checked": 1,
"text": "<p>选项1</p>\n"
}]
}, {
"id": "g-2-EFGH",
"options": [{
"id": "o-101-EFGH",
"checked": 1,
"text": "<p>选项2</p>\n"
}]
}]
}, {
"id": "q-9-vsfe",
"type": "matrix_star",
"groups": [{
"id": "g-1-ABCD",
"text": "4"
}, {
"id": "g-2-EFGH",
"text": "3"
}]
}, {
"id": "q-10-qqJa",
"type": "sort",
"options": [{
"id": "o-101-EFGH",
"sort_no": 1
}, {
"id": "o-100-ABCD",
"sort_no": 2
}]
}, {
"id": "q-11-8Doi",
"type": "chained_selects",
"id_list": ["9-R8", "13-0y", "15-ZP"],
"text_list": ["广西", "阳朔", "2区"]
}, {
"id": "q-12-910K",
"type": "upload",
"file_name_src": "四庫史部97.txt",
"file_name_dst": "292185_0_570d6e4e5f36954ec1baa2b0a8d21135.txt"
}, {
"id": "q-14-qF3P",
"type": "text_multiple",
"blanks": [{
"id": "fillblank-qVzp",
"value": "1234"
}]
}]
}],
"latitude": "",
"longitude": "",
"is_update": false
}
}