获取回答详情
接口概述
- 功能:获取问卷的某个回答详情
- 请求方式:GET
- 请求地址:/api/surveys/{survey_id}/answers/{answer_id}?appid={appid}&access_token={access_token}
请求参数
参数名 | 类型 | 参数位置 | 描述 | 示例值 |
---|---|---|---|---|
survey_id | integer | uri | 问卷ID | 292192 |
answer_id | integer | uri | 答案ID | 2 |
响应参数
参数名 | 类型 | 描述 |
---|---|---|
survey_id | integer | 问卷ID |
answer_id | integer | 答卷ID |
respondent_id | integer | 用户标识 (答题人在问卷系统中的ID,答题免登录情况下返回0) |
openid | string | 非微信OpenID,废弃字段 |
integer | 用户在腾讯问卷的QQ号(已废弃,请勿使用) | |
weixin_openid | string | 用户在腾讯问卷的微信OpenID(已废弃,请勿使用) |
started_at | string | 用户开始回答的时间 |
ended_at | string | 用户提交答案的时间 |
score | integer | 用户回答的分数(默认null)(暂不提供) |
third_party_user | object | 第三方用户信息(特定使用,关联第三方系统对接) |
answer | array[object] | 用户的回答详情(每个问卷的结构不一样,结构也会有所出入,实际数据结构以实际推送的为准) |
响应参数-answer
参数名 | 类型 | 描述 |
---|---|---|
id | string | 问卷页码 |
questions | array[object] | 详细回答详情 |
questions[_].id | string | 题目ID |
questions[_].type | string | 题目类型 |
questions[_].text | string | 文本输入(单行文本、多行文本、量表题等) |
questions[_].options | array[object] | 选择输入(下拉、多选、排序等) |
questions[_].options[_].id | string | 回答ID |
questions[_].options[_].checked | integer | 是否选中(默认1) |
questions[_].options[_].text | string | 回答内容 |
questions[_].groups | array[object] | 组合输入(矩阵多选、矩阵单选、矩阵量表等) |
questions[_].groups[_].id | string | 回答ID |
questions[_].groups[_].text | string | 矩阵量表题 |
questions[_].groups[_].options | array[object] | 组合详情 |
questions[_].groups[_].options[_].id | string | 回答ID |
questions[_].groups[_].options][_].checked | integer | 是否选中(默认1) |
questions[_].groups[_].options][_].text | string | 回答内容 |
questions[_].blanks | array[object] | 填空题 |
questions[_].blanks[_].id | string | 填空题ID |
questions[_].blanks[_].value | string | 填空题内容 |
questions[_].id_list | array[string] | 联动题-题目ID |
questions[_].text_list | array[string] | 联动题-ID对应内容 |
questions[_].file_name_src | string | 废弃 |
questions[_].file_name_dst | string | 废弃 |
questions[_].files | array[object] | 回答者上传的附件 |
questions[_].files[_].name | string | 附件名称 |
questions[_].files[_].url | string | 附件下载地址(有效期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 | 参数校验不通过 |