Skip to main content
Version: latest

修改回答内容

接口概述#

  • 功能:添加回答内容
  • 请求方式: POST
  • 请求地址:/api/surveys/{survey_id}/answers/{answer_id}

请求参数#

基本参数#

参数名类型参数位置描述示例值
survey_idintegeruri问卷ID292192
answer_idintegeruri回答ID1
start_atintegerbody回答开始时间1626260840
end_atintegerbody回答结束时间1626260841
answerobjectbody回答内容
answer.survey_typeintegerbody问卷类型0普通问卷,1测评问卷
answer.jsonLoadTimeintegerbody答题总时长(秒)10
answer.timeintegerbody答题结束时间戳1625835392
answer.uastringbody浏览器 user-agentMozilla/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.referrerstringbody答题页面的来源地址https://wj.qq.com/deliver.html?sid=292194
answer.uidstringbody随机生成的用户标识传空字符串即可
answer.sidstringbody随机生成的答题标识传空字符串即可
answer.openidstringbody自定义字段,从答题页链接的query参数获得,入库后有单独字段保存,支持统计、导出abcdefg
answer.latitudestringbody用户定位坐标维度"22.527735929411932"
answer.longitudestringbody用户定位坐标经度"113.93811254994733"
answer.is_updateboolbody是否修改上次答案,是则数据库不更新数据,仅查找该用户的上一次提交进行修改false
answer.pagesarray[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    }}