Skip to main content
Version: latest

获取回答列表

重要提示

该功能为 尊享版 付费功能,如未升级,请先 升级 后再使用

接口概述#

  • 功能:获取问卷的回答列表
  • 请求方式:GET
  • 请求地址:/api/surveys/{survey_id}/answers?appid={appid}&access_token={access_token}&per_page={1}&last_answer_id={0}

请求参数#

参数名类型参数位置描述示例值
survey_idintegeruri问卷ID292192
per_pageintegerqueryString每页显示条数20
last_answer_idintegerqueryString下页开始ID2

响应参数#

参数名类型描述
totalinteger总条数
last_answer_idinteger下一页从此ID开始(用于分页)
listarray[object]回答列表(每个问卷的结构不一样,结构也会有所出入,实际数据结构以实际推送的为准)
list[_].answer_idinteger答案ID
list[_].qqinteger用户标识
list[_].openidstring非微信OpenID,废弃字段
list[_].started_atstring用户开始回答的时间
list[_].ended_atstring用户提交答案的时间
list[_].scoreinteger用户回答的分数(默认null)(暂不提供)
list[_].wechat_work_userobject企业微信用户信息(特定使用)
list[_].third_party_userobject第三方用户信息(特定使用,关联第三方系统对接
list[_].answerarray[object]用户的回答详情

响应参数-answer#

参数名类型描述
idstring问卷页码
questionsarray[object]详细回答详情
questions[_].idstring题目ID
question[_].typestring题目类型,可参考题目类型
question[_].sub_typestring题目子类型,枚举可参考题目类型
questions[_].textstring文本输入(单行文本、多行文本、量表题等)
questions[_].optionsarray[object]选择输入(下拉、多选、排序等)
questions[_].options[_].idstring回答ID
questions[_].options[_].checkedinteger是否选中(默认1)
questions[_].options[_].textstring回答内容
questions[_].groupsarray[object]组合输入(矩阵多选、矩阵单选、矩阵量表等)
questions[_].groups[_].idstring回答ID
questions[_].groups[_].textstring矩阵量表题
questions[_].groups[_].optionsarray[object]组合详情
questions[_].groups[_].options[_].idstring回答ID
questions[_].groups[_].options][_].checkedinteger是否选中(默认1)
questions[_].groups[_].options][_].textstring回答内容
questions[_].blanksarray[object]填空题
questions[_].blanks[_].idstring填空题ID
questions[_].blanks[_].valuestring填空题内容
questions[_].id_listarray[string]联动题-题目ID
questions[_].text_listarray[string]联动题-ID对应内容
questions[_].file_name_srcstring废弃
questions[_].file_name_dststring废弃
questions[_].filesarray[object]回答者上传的附件
questions[_].files[_].namestring附件名称
questions[_].files[_].urlstring附件下载地址(有效期7天)

响应参数-第三方用户信息-third_party_user#

参数名类型描述
third_party_user.respondent_idinteger问卷系统中回答者身份ID,与创建第三方用户返回值对应
third_party_user.openidstring第三方用户标识
third_party_user.nicknamestring第三方用户昵称

响应示例#

  • 请求成功
{    "code": "OK",    "error": {        "type": ""    },    "data": {        "total": 1,        "list": [            {                "survey_id": 292192,                "answer_id": 4,                "qq": 60000000004,                "openid": "",                "started_at": "2021-06-28 14:18:38",                "ended_at": "2021-06-28 14:20:16",                "score": 1,                "wechat_work_user": {                    "corpid": "",                    "company_name": "",                    "user_id": "",                    "department_ids": null,                    "name": ""                },                "third_party_user": {                    "respondent_id": 60000000004,                    "openid": "abcdefg",                    "nickname": "张三"                },                "answer": [                    {                        "id": "1",                        "questions": [                            {                                "id": "q-1-qkPo",                                "type": "radio",                                "options": [                                    {                                        "id": "o-100-ABCD",                                        "checked": 1,                                        "text": "<p>单选答案1</p>\n"                                    }                                ]                            },                            {                                "id": "q-2-EWMS",                                "type": "select",                                "options": [                                    {                                        "id": "o-101-EFGH",                                        "checked": 1,                                        "text": "下拉题目2"                                    }                                ]                            },                            {                                "id": "q-3-iBsI",                                "type": "checkbox",                                "options": [                                    {                                        "id": "o-2-tINm",                                        "checked": 1,                                        "text": "<p>多选答案3</p>\n"                                    }                                ]                            },                            {                                "id": "q-4-5Vtm",                                "type": "text",                                "text": "单行文本-自己输入的"                            },                            {                                "id": "q-5-U149",                                "type": "textarea",                                "text": "多行文本\n自己输入的"                            },                            {                                "id": "q-6-0uZR",                                "type": "star",                                "text": "4"                            },                            {                                "id": "q-7-nOBv",                                "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-B3fI",                                "type": "matrix_checkbox",                                "groups": [                                    {                                        "id": "g-1-ABCD",                                        "options": [                                            {                                                "id": "o-100-ABCD",                                                "checked": 1,                                                "text": "<p>选项1</p>\n"                                            },                                            {                                                "id": "o-101-EFGH",                                                "checked": 1,                                                "text": "<p>选项2</p>\n"                                            }                                        ]                                    },                                    {                                        "id": "g-2-EFGH",                                        "options": [                                            {                                                "id": "o-100-ABCD",                                                "checked": 1,                                                "text": "<p>选项1</p>\n"                                            }                                        ]                                    }                                ]                            }                        ]                    },                    {                        "id": "p-2-bKoP",                        "questions": [                            {                                "id": "q-9-XKAl",                                "type": "sort",                                "options": [                                    {                                        "id": "o-101-EFGH",                                        "checked": 0,                                        "text": ""                                    },                                    {                                        "id": "o-100-ABCD",                                        "checked": 0,                                        "text": ""                                    }                                ]                            },                            {                                "id": "q-10-XC8E",                                "type": "chained_selects",                                "id_list": [                                    "2-wA",                                    "3-v9",                                    "4-1L"                                ],                                "text_list": [                                    "一级答案",                                    "二级答案",                                    "三级答案"                                ]                            },                            {                                "id": "q-11-3rG8",                                "type": "upload",                                "file_name_src": "logo.png",                                "file_name_dst": "292192_0_6603fef4e5abd7616bfef24eb516aaef.png",                                "files": [                                    {                                        "name": "logo.png",                                        "url": "https://wj.qq.com/api/files/show?file_id=123&survey_id=292192&question_id=q-11-3rG8&file_name=292192_0_6603fef4e5abd7616bfef24eb516aaef.png"                                    },                                    {                                        "name": "logo2.png",                                        "url": "https://wj.qq.com/api/files/show?file_id=124&survey_id=292192&question_id=q-11-3rG8&file_name=292192_0_6603fef4e5abd7616bfef24eb516aaeh.png"                                    }                                ],                                "expired": "7d"                            },                            {                                "id": "q-13-ngwO",                                "type": "text_multiple",                                "blanks": [                                    {                                        "id": "fillblank-7TqK",                                        "value": "填什么呀"                                    }                                ]                            }                        ]                    },                    {                        "id": "custom_args",                        "questions": [                            {                                "id": "custom-arg-01",                                "type": "text",                                "text": "123"                            }                        ]                    }                ]            }        ],        "last_answer_id": 1,        "request_id": "e4b27037-d876-427d-95c7-d5a737dd1677"    }}
  • 请求失败
{    "code": "InvalidArgument",    "error": {        "type": "invalid_argument",    },    "data": {},    "request_id": "ddec96d2-165e-4f3e-8a64-2057db116983"}

错误码#

error.type 错误代码错误描述
not_found找不到数据
claim_error权限校验错误
invalid_argument参数校验不通过