When a webhook is configured, Insights will send a POST, with JSON.
To configure a web hook, simply add the webhook action to a workflow and then specify the receiving URL. This URL should be accessible publicly. If you'd like to add some kind of authentication to the URL, then we suggest you use a SSL HTTPS url and include the secret in the URL as a parameter, such as https://www.example.com/webhook.php?key=my_secret_key.
Once you've entered the url, you can submit a Test Webhook and log the request in your webhook script.
The JSON will consist of the below information. To see the actual JSON request, we suggest using request.bin, doing a test JSON request and parsing the request using a JSON parser to see a visual representation.
- ...any attributes of the event...
- Standard Subscriber Attributes
- Custom Subscriber Attributes
- Standard Owner Attributes (if multi-location framework is turned on)
- Custom Owner Attributes (if multi-location framework is turned on)
<?php $json = file_get_contents('php://input'); $result = json_decode($json, true); print $result[event][name]; // => Visit print $result[personIdentifier]; // => firstname.lastname@example.org print $result[standardSubscriberAttributes][opt_status]; // => active print $result[customSubscriberAttributes][first_name]; // => Dan print_r($result); // => see the entire array ?>
Our Webhook system will continue to retry a webhook url that is returning an error based on the below logic
- We will continue to retry for 12hrs or 15 attempts with exponential back-off time period