2016-11-28 33 views
0

理想的情況下調用此API - https://api.surveymonkey.net/v2/surveys/get_responsesPOST:get_responses API沒有給予必要的數據

應該給這樣的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控制檯適當的響應。

回答

0

如果您使用API​​第3版,你可能會得到一個更好的錯誤消息:

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

看來你的問題可能是,你必須爲調查超過100個回覆,你只能訪問第一100從我從日誌中看到的基本計劃。

如果是這樣的情況下,解決辦法是

  1. 升級你的計劃
  2. 刪除一些舊的迴應
  3. 也許重複調查?

我再次建議轉移到V3的API以獲得更好的體驗。

相關問題