POST:get_responses API未提供所需数据

时间:2016-11-28 14:55:25

标签: rest api survey surveymonkey

理想情况下,对此API的调用 - https://api.surveymonkey.net/v2/surveys/get_responses

应该给出像这样的json响应:

{
    "data": [
        {
            "questions": [
                {
                    "answers": [
                        {
                            "col": "3024965133",
                            "row": "3024965139"
                        },
                        {
                            "col": "3024965134",
                            "row": "3024965140"
                        },
                        {
                            "col": "3024965135",
                            "row": "3024965141"
                        },
                        {
                            "row": "0",
                            "text": "Other!"
                        }
                    ],
                    "question_id": "316084770"
                },
                {
                    "answers": [
                        {
                            "col": "3024965125",
                            "row": "3024965122"
                        },
                        {
                            "col": "3024965124",
                            "row": "3024965123"
                        }
                    ],
                    "question_id": "316084761"
                },
                {
                    "answers": [
                        {
                            "row": "3024959616"
                        }
                    ],
                    "question_id": "316083321"
                },
                {
                    "answers": [
                        {
                            "row": "0",
                            "text": "This is an open answer"
                        }
                    ],
                    "question_id": "316083320"
                },
                {
                    "answers": [
                        {
                            "col": "3024962639",
                            "row": "3024962638"
                        },
                        {
                            "col": "3024962640",
                            "row": "3024962637"
                        },
                        {
                            "col": "3024962639",
                            "row": "3024962636"
                        }
                    ],
                    "question_id": "316084090"
                },
                {
                    "answers": [
                        {
                            "row": "3024964761",
                            "text": "9"
                        },
                        {
                            "row": "3024964762",
                            "text": "1"
                        }
                    ],
                    "question_id": "316084724"
                }
            ],
            "respondent_id": "2500019027"
        }
    ],
    "status": 0
}

但是当我要求特定受访者回复我的调查API时,我得到一个空白数组。

enter image description here

注意:我可以通过SurveyMonkey UI控制台查看正确的响应。

1 个答案:

答案 0 :(得分:0)

如果您使用API​​ v3,则可能会收到更好的错误消息:

https://developer.surveymonkey.com/api/v3/#surveys-id-responses

看来你的问题可能是你有超过100个针对该调查的回复,你只能从我从日志中看到的基本计划中访问前100个。

如果是这种情况,解决方案就是

  1. 升级您的计划
  2. 删除一些旧回复
  3. 可能会重复调查吗?
  4. 我再次建议转到API的V3以获得更好的体验。