SurveyMonkey Webhook事件数据

时间:2017-01-13 13:42:39

标签: webhooks surveymonkey

我无法解释返回的webhook事件数据的结果。如果这是返回的数据:

{
    "name":"Test Webhook",
    "event_id":"EVENT ID HERE",
    "object_type":"response",
    "object_id":"OBJECT ID HERE",
    "event_datetime":"2017-01-12T15:10:18.667701+00:00",
    "event_type":"response_completed"
}

我知道object_id对应于responseId,但我想弄清楚surveyId在哪里?

当我们收到事件数据时,我们需要进行以下API调用: '调查/' $ surveyId' /响应/' $ responseId' /细节'这样我们就可以得到处理的细节。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

最近更新了发送到您的订阅网址的webhook数据。请参阅the docs中的详细信息。

有效负载有一些新值,它现在看起来像这样(取决于你的事件类型):

{
  "name": "My Webhook",
  "filter_type": "collector", (or survey, it's based on how they configure the webhook)
  "filter_id": "123456789",
  "event_type": "response_completed",
  "event_id": "123456789",
  "object_type": "response",
  "object_id": "123456",
  "event_datetime": "2016-01-01T21:56:31.182613+00:00",
  "resources": {
    "respondent_id": "123456789",
    "recipient_id": "123456789",
    "collector_id": "123456789",
    "survey_id": "123456789",
    "user_id": "123456789"
  }
}

因此,如果您的活动是“response_completed”,那么object_id就是响应ID。如果您过滤到特定类型的调查,则filter_id是调查ID。

还有一个resources密钥,其中包含许多相关ID。