Get Response Details
API Overview
- Function: Get details of a specific survey response
- Request Method: GET
- Request URL: /api/surveys/{survey_id}/answers/{answer_id}?appid={appid}&access_token={access_token}
Request Parameters
Parameter Name | Type | Location | Description | Example |
---|---|---|---|---|
survey_id | integer | uri | Survey ID | 292192 |
answer_id | integer | uri | Response ID | 2 |
Response Parameters
Parameter Name | Type | Description |
---|---|---|
survey_id | integer | Survey ID |
answer_id | integer | Response ID |
respondent_id | integer | User identifier (ID in the survey system, returns 0 if anonymous) |
openid | string | Non-WeChat OpenID, deprecated field |
integer | User's QQ number in WeSurvey (Deprecated, do not use) | |
weixin_openid | string | User's WeChat OpenID in WeSurvey (Deprecated, do not use) |
started_at | string | Time when user started answering |
ended_at | string | Time when user submitted the response |
score | integer | Response score (default null) (Not available yet) |
third_party_user | object | Third-party user information (Specific use, related to Third-party System Integration) |
answer | array[object] | User's response details (Structure varies by survey, actual data structure follows the pushed data) |
Response Parameters - answer
Parameter Name | Type | Description |
---|---|---|
id | string | Survey page number |
questions | array[object] | Detailed response information |
questions[_].id | string | Question ID |
questions[_].type | string | Question type |
questions[_].text | string | Text input (Single line text, Multiple line text, Rating scale, etc.) |
questions[_].options | array[object] | Choice input (Dropdown, Multiple choice, Ranking, etc.) |
questions[_].options[_].id | string | Response ID |
questions[_].options[_].checked | integer | Whether selected (default 1) |
questions[_].options[_].text | string | Response content |
questions[_].groups | array[object] | Combined input (Matrix multiple choice, Matrix single choice, Matrix rating scale, etc.) |
questions[_].groups[_].id | string | Response ID |
questions[_].groups[_].text | string | Matrix rating scale |
questions[_].groups[_].options | array[object] | Group details |
questions[_].groups[_].options[_].id | string | Response ID |
questions[_].groups[_].options][_].checked | integer | Whether selected (default 1) |
questions[_].groups[_].options][_].text | string | Response content |
questions[_].blanks | array[object] | Fill-in-the-blank |
questions[_].blanks[_].id | string | Blank ID |
questions[_].blanks[_].value | string | Blank content |
questions[_].id_list | array[string] | Cascade question - Question IDs |
questions[_].text_list | array[string] | Cascade question - Corresponding content |
questions[_].file_name_src | string | Deprecated |
questions[_].file_name_dst | string | Deprecated |
questions[_].files | array[object] | Files uploaded by respondent |
questions[_].files[_].name | string | File name |
questions[_].files[_].url | string | File download URL (Valid for 7 days) |
Response Examples
- Successful Request
{
"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", // First page
"questions": [
{
"id": "q-1-qkPo", // Question ID
"type": "radio", // Question type - Single choice
"options": [
{
"id": "o-100-ABCD", // Response ID
"checked": 1, // Selected
"text": "<p>Single choice answer 1</p>\n" // Response content
}
]
},
{
"id": "q-2-EWMS",
"type": "select", // Question type - Dropdown
"options": [
{
"id": "o-100-ABCD",
"checked": 1,
"text": "Dropdown option 1"
}
]
},
{
"id": "q-3-iBsI",
"type": "checkbox", // Question type - Multiple choice
"options": [
{
"id": "o-101-EFGH",
"checked": 1,
"text": "<p>Multiple choice answer 2</p>\n"
},
{
"id": "o-2-tINm",
"checked": 1,
"text": "<p>Multiple choice answer 3</p>\n"
}
]
},
{
"id": "q-4-5Vtm",
"type": "text", // Question type - Single line text
"text": "23123"
},
{
"id": "q-5-U149",
"type": "textarea", // Question type - Multiple line text
"text": "23123"
},
{
"id": "q-6-0uZR",
"type": "star", // Question type - Rating scale
"text": "3"
},
{
"id": "q-7-nOBv",
"type": "matrix_radio", // Question type - Matrix single choice
"groups": [
{
"id": "g-1-ABCD",
"options": [
{
"id": "o-100-ABCD",
"checked": 1,
"text": "<p>Option 1</p>\n"
}
]
},
{
"id": "g-2-EFGH",
"options": [
{
"id": "o-101-EFGH",
"checked": 1,
"text": "<p>Option 2</p>\n"
}
]
}
]
},
{
"id": "q-8-B3fI",
"type": "matrix_checkbox", // Question type - Matrix multiple choice
"groups": [
{
"id": "g-1-ABCD",
"options": [
{
"id": "o-100-ABCD",
"checked": 1,
"text": "<p>Option 1</p>\n"
},
{
"id": "o-101-EFGH",
"checked": 1,
"text": "<p>Option 2</p>\n"
}
]
},
{
"id": "g-2-EFGH",
"options": [
{
"id": "o-101-EFGH",
"checked": 1,
"text": "<p>Option 2</p>\n"
}
]
}
]
},
{
"id": "q-14-hYBP",
"type": "matrix_star", // Question type - Matrix rating scale
"groups": [
{
"id": "g-1-ABCD",
"text": "3"
},
{
"id": "g-2-EFGH",
"text": "4"
}
]
}
]
},
{
"id": "p-2-bKoP", // Second page
"questions": [
{
"id": "q-9-XKAl",
"type": "sort", // Question type - Ranking
"options": [
{
"id": "o-100-ABCD",
"checked": 0,
"text": ""
},
{
"id": "o-101-EFGH",
"checked": 0,
"text": ""
}
]
},
{
"id": "q-10-XC8E",
"type": "chained_selects", // Question type - Cascade
"id_list": [
"2-wA",
"3-v9",
"4-1L"
],
"text_list": [
"Level 1 answer",
"Level 2 answer",
"Level 3 answer"
]
},
{
"id": "q-11-3rG8",
"type": "upload", // Question type - Attachment
"file_name_src": "logo.png", // Deprecated, use files content
"file_name_dst": "292192_0_6603fef4e5abd7616bfef24eb516aaef.png", // Deprecated, use files content
"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", // Question type - Fill-in-the-blank
"blanks": [
{
"id": "fillblank-7TqK",
"value": "23213"
}
]
}
]
}
]
},
"request_id": "e4b27037-d876-427d-95c7-d5a737dd1677"
}
- Failed Request
{
"code": "InvalidArgument",
"error": {
"type": "invalid_argument",
},
"data": {},
"request_id": "ddec96d2-165e-4f3e-8a64-2057db116983"
}
Error Codes
error.type Code | Description |
---|---|
not_found | Data Not Found |
invalid_argument | Parameter Validation Failed |