doudu9148 2015-08-31 11:31
浏览 22

SurveyMonkey:过滤get_survey_details响应

I'm trying to retrieve the responses for a particular survey from Survey Monkey using the get_responses endpoint which only retrieves the "col" and "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"
        },
      ]
    }
  ]
}

I can see that these id's correlate to a question and answer from the get_survey_details endpoint..

But how on earth do you filter the get_survey_details response to only show the question/answer that the respondent has given rather than retrieve everything? I've tried adding to the $params in the class as shown but the request still gives everything back... so clearly this isn't possible or I'm going about it in completely the wrong way:

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);
    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
    • ¥20 关于URL获取的参数,无法执行二选一查询
    • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
    • ¥15 marlin编译错误,如何解决?
    • ¥15 有偿四位数,节约算法和扫描算法
    • ¥15 VUE项目怎么运行,系统打不开
    • ¥50 pointpillars等目标检测算法怎么融合注意力机制
    • ¥20 Vs code Mac系统 PHP Debug调试环境配置
    • ¥60 大一项目课,微信小程序
    • ¥15 求视频摘要youtube和ovp数据集