Skip to main content

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 NameTypeLocationDescriptionExample
survey_idintegeruriSurvey ID292192
per_pageintegerqueryStringItems per page20
last_answer_idintegerqueryStringStarting ID for next page2

Response Parameters

Parameter NameTypeDescription
totalintegerTotal count
last_answer_idintegerStarting ID for next page (for pagination)
listarray[object]Answer list (structure varies by survey, actual data structure follows the pushed data)
list[_].answer_idintegerAnswer ID
list[_].qqintegerUser identifier
list[_].openidstringNon-WeChat OpenID, deprecated field
list[_].started_atstringTime when user started answering
list[_].ended_atstringTime when user submitted answer
list[_].scoreintegerUser's score (default null) (not currently provided)
list[_].wechat_work_userobjectWeCom user information (specific use)
list[_].third_party_userobjectThird-party user information (specific use, related to Third-party System Integration)
list[_].answerarray[object]User's answer details

Response Parameters - answer

Parameter NameTypeDescription
idstringSurvey page number
questionsarray[object]Detailed answer information
questions[_].idstringQuestion ID
question[_].typestringQuestion type, refer to Question Types
question[_].sub_typestringQuestion subtype, refer to Question Types
questions[_].textstringText input (single-line text, multi-line text, scale questions, etc.)
questions[_].optionsarray[object]Choice input (dropdown, multiple choice, sorting, etc.)
questions[_].options[_].idstringAnswer ID
questions[_].options[_].checkedintegerWhether selected (default 1)
questions[_].options[_].textstringAnswer content
questions[_].groupsarray[object]Combined input (matrix multiple choice, matrix single choice, matrix scale, etc.)
questions[_].groups[_].idstringAnswer ID
questions[_].groups[_].textstringMatrix scale question
questions[_].groups[_].optionsarray[object]Group details
questions[_].groups[_].options[_].idstringAnswer ID
questions[_].groups[_].options][_].checkedintegerWhether selected (default 1)
questions[_].groups[_].options][_].textstringAnswer content
questions[_].blanksarray[object]Fill-in questions
questions[_].blanks[_].idstringFill-in question ID
questions[_].blanks[_].valuestringFill-in content
questions[_].id_listarray[string]Cascade question - Question IDs
questions[_].text_listarray[string]Cascade question - Corresponding content
questions[_].file_name_srcstringDeprecated
questions[_].file_name_dststringDeprecated
questions[_].filesarray[object]Files uploaded by respondent
questions[_].files[_].namestringFile name
questions[_].files[_].urlstringFile download URL (valid for 7 days)

Response Parameters - Third-party User Information - third_party_user

Parameter NameTypeDescription
third_party_user.respondent_idintegerRespondent ID in survey system, corresponds to create third-party user return value
third_party_user.openidstringThird-party user identifier
third_party_user.nicknamestringThird-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 CodeDescription
not_foundData not found
claim_errorPermission verification error
invalid_argumentParameter validation failed