【问题标题】:SurveyMonkey Webhook Event DataSurveyMonkey Webhook 事件数据
【发布时间】:2017-05-28 21:45:36
【问题描述】:

我很难解释返回的 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: 'surveys/'.$surveyId.'/responses/'.$responseId.'/details' 以便我们获取详细信息进行处理。

非常感谢任何帮助。

【问题讨论】:

    标签: webhooks surveymonkey


    【解决方案1】:

    发送到您的订阅 URL 的 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。

    还有一个带有一堆相关 ID 的 resources 键。

    【讨论】:

    • 谢谢。他们一定是在一两天内添加了资源。
    猜你喜欢
    • 1970-01-01
    • 2016-03-06
    • 2019-06-08
    • 2019-03-03
    • 2018-03-09
    • 1970-01-01
    • 2017-01-13
    • 1970-01-01
    • 2021-06-05
    相关资源
    最近更新 更多