Skip to main content

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 NameTypeLocationDescriptionExample
survey_idintegeruriSurvey ID292192
answer_idintegeruriResponse ID2

Response Parameters

Parameter NameTypeDescription
survey_idintegerSurvey ID
answer_idintegerResponse ID
respondent_idintegerUser identifier (ID in the survey system, returns 0 if anonymous)
openidstringNon-WeChat OpenID, deprecated field
qqintegerUser's QQ number in WeSurvey (Deprecated, do not use)
weixin_openidstringUser's WeChat OpenID in WeSurvey (Deprecated, do not use)
started_atstringTime when user started answering
ended_atstringTime when user submitted the response
scoreintegerResponse score (default null) (Not available yet)
third_party_userobjectThird-party user information (Specific use, related to Third-party System Integration)
answerarray[object]User's response details (Structure varies by survey, actual data structure follows the pushed data)

Response Parameters - answer

Parameter NameTypeDescription
idstringSurvey page number
questionsarray[object]Detailed response information
questions[_].idstringQuestion ID
questions[_].typestringQuestion type
questions[_].textstringText input (Single line text, Multiple line text, Rating scale, etc.)
questions[_].optionsarray[object]Choice input (Dropdown, Multiple choice, Ranking, etc.)
questions[_].options[_].idstringResponse ID
questions[_].options[_].checkedintegerWhether selected (default 1)
questions[_].options[_].textstringResponse content
questions[_].groupsarray[object]Combined input (Matrix multiple choice, Matrix single choice, Matrix rating scale, etc.)
questions[_].groups[_].idstringResponse ID
questions[_].groups[_].textstringMatrix rating scale
questions[_].groups[_].optionsarray[object]Group details
questions[_].groups[_].options[_].idstringResponse ID
questions[_].groups[_].options][_].checkedintegerWhether selected (default 1)
questions[_].groups[_].options][_].textstringResponse content
questions[_].blanksarray[object]Fill-in-the-blank
questions[_].blanks[_].idstringBlank ID
questions[_].blanks[_].valuestringBlank 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 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 CodeDescription
not_foundData Not Found
invalid_argumentParameter Validation Failed