Get Answer List
API Overview
- Function: Get survey answer list
- Request Method: GET
- Request URL: /api/surveys/{survey_id}/answers?appid={appid}&access_token={access_token}&per_page={1}&last_answer_id={0}
Request Parameters
Parameter Name | Type | Location | Description | Example |
---|---|---|---|---|
survey_id | integer | uri | Survey ID | 292192 |
per_page | integer | queryString | Items per page | 20 |
last_answer_id | integer | queryString | Starting ID for next page | 2 |
Response Parameters
Parameter Name | Type | Description |
---|---|---|
total | integer | Total count |
last_answer_id | integer | Starting ID for next page (for pagination) |
list | array[object] | Answer list (structure varies by survey, actual data structure follows the pushed data) |
list[_].answer_id | integer | Answer ID |
list[_].qq | integer | User identifier |
list[_].openid | string | Non-WeChat OpenID, deprecated field |
list[_].started_at | string | Time when user started answering |
list[_].ended_at | string | Time when user submitted answer |
list[_].score | integer | User's score (default null) (not currently provided) |
list[_].wechat_work_user | object | WeCom user information (specific use) |
list[_].third_party_user | object | Third-party user information (specific use, related to Third-party System Integration) |
list[_].answer | array[object] | User's answer details |
Response Parameters - answer
Parameter Name | Type | Description |
---|---|---|
id | string | Survey page number |
questions | array[object] | Detailed answer information |
questions[_].id | string | Question ID |
question[_].type | string | Question type, refer to Question Types |
question[_].sub_type | string | Question subtype, refer to Question Types |
questions[_].text | string | Text input (single-line text, multi-line text, scale questions, etc.) |
questions[_].options | array[object] | Choice input (dropdown, multiple choice, sorting, etc.) |
questions[_].options[_].id | string | Answer ID |
questions[_].options[_].checked | integer | Whether selected (default 1) |
questions[_].options[_].text | string | Answer content |
questions[_].groups | array[object] | Combined input (matrix multiple choice, matrix single choice, matrix scale, etc.) |
questions[_].groups[_].id | string | Answer ID |
questions[_].groups[_].text | string | Matrix scale question |
questions[_].groups[_].options | array[object] | Group details |
questions[_].groups[_].options[_].id | string | Answer ID |
questions[_].groups[_].options][_].checked | integer | Whether selected (default 1) |
questions[_].groups[_].options][_].text | string | Answer content |
questions[_].blanks | array[object] | Fill-in questions |
questions[_].blanks[_].id | string | Fill-in question ID |
questions[_].blanks[_].value | string | Fill-in 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 Parameters - Third-party User Information - third_party_user
Parameter Name | Type | Description |
---|---|---|
third_party_user.respondent_id | integer | Respondent ID in survey system, corresponds to create third-party user return value |
third_party_user.openid | string | Third-party user identifier |
third_party_user.nickname | string | Third-party user nickname |
Response Examples
- Successful Request
{
"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": "John Doe"
},
"answer": [
{
"id": "1",
"questions": [
{
"id": "q-1-qkPo",
"type": "radio",
"options": [
{
"id": "o-100-ABCD",
"checked": 1,
"text": "<p>Single choice answer 1</p>\n"
}
]
},
{
"id": "q-2-EWMS",
"type": "select",
"options": [
{
"id": "o-101-EFGH",
"checked": 1,
"text": "Dropdown option 2"
}
]
},
{
"id": "q-3-iBsI",
"type": "checkbox",
"options": [
{
"id": "o-2-tINm",
"checked": 1,
"text": "<p>Multiple choice answer 3</p>\n"
}
]
},
{
"id": "q-4-5Vtm",
"type": "text",
"text": "Single-line text - self input"
},
{
"id": "q-5-U149",
"type": "textarea",
"text": "Multi-line text\nself input"
},
{
"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>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",
"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-100-ABCD",
"checked": 1,
"text": "<p>Option 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": [
"Level 1 answer",
"Level 2 answer",
"Level 3 answer"
]
},
{
"id": "q-11-3rG8",
"type": "upload",
"file_name_src": "logo.png",
"file_name_dst": "292192_0_6603fef4e5abd7616bfef24eb516aaef.png",
"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": "What to fill in"
}
]
}
]
},
{
"id": "custom_args",
"questions": [
{
"id": "custom-arg-01",
"type": "text",
"text": "123"
}
]
}
]
}
],
"last_answer_id": 1,
"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 Error Code | Description |
---|---|
not_found | Data not found |
claim_error | Permission verification error |
invalid_argument | Parameter validation failed |