我尝试使用get_responses端点从Survey Monkey检索特定调查的响应,该端点仅检索" col" " row" IDS。
{
"status": 0,
"data": [
{
"respondent_id": "4165059283",
"questions": [
{
"answers": [
{
"text": "04/11/1990",
"row": "9333771686"
}
],
"question_id": "842633241"
},
{
"answers": [
{
"row": "9333771693"
},
{
"text": "aa",
"row": "9333771691"
}
],
"question_id": "842633242"
},
{
"answers": [
{
"col": "9333771714",
"row": "9333771713"
},
{
"col": "9333771717",
"row": "9333771712"
},
{
"col": "9333771714",
"row": "9333771711"
},
{
"col": "9333771717",
"row": "9333771710"
},
{
"col": "9333771717",
"row": "9333771709"
},
{
"col": "9333771716",
"row": "9333771708"
},
{
"col": "9333771714",
"row": "9333771707"
},
{
"col": "9333771716",
"row": "9333771706"
},
{
"col": "9333771716",
"row": "9333771705"
},
{
"col": "9333771715",
"row": "9333771704"
},
{
"col": "9333771715",
"row": "9333771703"
},
{
"col": "9333771714",
"row": "9333771702"
},
{
"text": "aa",
"row": "0"
}
],
"question_id": "842633243"
},
{
"answers": [
{
"col": "9333771729",
"row": "9333771726"
},
{
"col": "9333771727",
"row": "9333771725"
},
{
"col": "9333771727",
"row": "9333771724"
},
{
"text": "aaa",
"row": "0"
}
],
"question_id": "842633244"
},
]
}
]
}
我可以看到这些ID与get_survey_details
端点的问答相关..
但是,您如何过滤get_survey_details
响应只显示受访者给出的问题/答案而不是检索所有内容?我已尝试在课程中添加$params
,但请求仍然会回复所有内容......所以很明显这是不可能的,或者我完全按照它进行操作错误的方式:
public function getSurveyDetails($surveyId){
//original $params
//$params = array('survey_id'=>$surveyId);
$params = array(
'survey_id'=>$surveyId,
'pages'=>array(
'questions' => array (
'answers' => array (
'answer_id' => '9333771686',
)
),
)
);
return $this->run('surveys/get_survey_details', $params);
}