跳到主要内容

获取回答详情

重要提示

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

接口概述

  • 功能:获取问卷的某个回答详情
  • 请求方式:GET
  • 请求地址:/api/surveys/{survey_id}/answers/{answer_id}?appid={appid}&access_token={access_token}

请求参数

参数名类型参数位置描述示例值
survey_idintegeruri问卷ID292192
answer_idintegeruri答案ID2

响应参数

参数名类型描述
survey_idinteger问卷ID
answer_idinteger答卷ID
respondent_idinteger用户标识 (答题人在问卷系统中的ID,答题免登录情况下返回0)
openidstring非微信OpenID,废弃字段
qqinteger用户在腾讯问卷的QQ号(已废弃,请勿使用)
weixin_openidstring用户在腾讯问卷的微信OpenID(已废弃,请勿使用)
started_atstring用户开始回答的时间
ended_atstring用户提交答案的时间
scoreinteger用户回答的分数(默认null)(暂不提供)
third_party_userobject第三方用户信息(特定使用,关联第三方系统对接)
answerarray[object]用户的回答详情(每个问卷的结构不一样,结构也会有所出入,实际数据结构以实际推送的为准)

响应参数-answer

参数名类型描述
idstring问卷页码
questionsarray[object]详细回答详情
questions[_].idstring题目ID
questions[_].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天)

响应示例

  • 请求成功
{
"code": "OK",
"error": {
"type": "",
},
"data": {
"survey_id": 292192,
"answer_id": 5,
"qq": 1411902221,
"openid": "",
"weixin_openid": "",
"started_at": "2021-07-01 10:51:54",
"ended_at": "2021-07-01 10:53:34",
"score": 1,
"third_party_user": {
"respondent_id": 1411902221,
"openid": "abcdefg",
"nickname": "张三"
},
"answer": [
{
"id": "1", // 第一页
"questions": [
{
"id": "q-1-qkPo", // 题目ID
"type": "radio", // 题目类型 - 单选题
"options": [
{
"id": "o-100-ABCD", // 回答ID
"checked": 1, // 选中
"text": "<p>单选答案1</p>\n" // 回答内容
}
]
},
{
"id": "q-2-EWMS",
"type": "select", // 题目类型 - 下拉题
"options": [
{
"id": "o-100-ABCD",
"checked": 1,
"text": "下拉题目1"
}
]
},
{
"id": "q-3-iBsI",
"type": "checkbox", // 题目类型 - 多选题
"options": [
{
"id": "o-101-EFGH",
"checked": 1,
"text": "<p>多选答案2</p>\n"
},
{
"id": "o-2-tINm",
"checked": 1,
"text": "<p>多选答案3</p>\n"
}
]
},
{
"id": "q-4-5Vtm",
"type": "text", // 题目类型 - 单行文本
"text": "23123"
},
{
"id": "q-5-U149",
"type": "textarea", // 题目类型 - 多行文本
"text": "23123"
},
{
"id": "q-6-0uZR",
"type": "star", // 题目类型 - 量表题
"text": "3"
},
{
"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-101-EFGH",
"checked": 1,
"text": "<p>选项2</p>\n"
}
]
}
]
},
{
"id": "q-14-hYBP",
"type": "matrix_star", // 题目类型 - 矩阵量表
"groups": [
{
"id": "g-1-ABCD",
"text": "3"
},
{
"id": "g-2-EFGH",
"text": "4"
}
]
}
]
},
{
"id": "p-2-bKoP", // 第二页
"questions": [
{
"id": "q-9-XKAl",
"type": "sort", // 题目类型 - 排序题
"options": [
{
"id": "o-100-ABCD",
"checked": 0,
"text": ""
},
{
"id": "o-101-EFGH",
"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", // 废弃,请使用 files 内容
"file_name_dst": "292192_0_6603fef4e5abd7616bfef24eb516aaef.png", // 废弃,请使用 files 内容
"files": [
{
"name": "logo.png",
"url": "https://wesurvey.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://wesurvey.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": "23213"
}
]
}
]
}
]
},
"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找不到数据
invalid_argument参数校验不通过