Reputation: 159
I am having difficulty interpreting the results of the webhook event data being returned. If this is the data being returned:
{
"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"
}
I understand that the object_id corresponds to the responseId but I am trying to figure out where the surveyId is?
When we get the event data back, we need to make an API call to: 'surveys/'.$surveyId.'/responses/'.$responseId.'/details' so that we can get the details for processing.
Any help is greatly appreciated.
Upvotes: 1
Views: 1109
Reputation: 2285
The webhook data sent to your subscription URL has recently been updated. See the details in the docs.
The payload has some new values, it looks something like this now (depending on your event type):
{
"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"
}
}
So if your event was "response_completed" then object_id
is the response ID. If you filtered to a specific type of survey then the filter_id
is the survey ID.
As well there is a resources
key with a bunch of relevant IDs.
Upvotes: 1