Processing webhook response

Processing webhook response

Webhooks can be used to send data from Exponea to 3rd party APIs but also to request data.

If the API responds with HTTP status code 200 and webhook is configured to process the response, it will be available in Personalization context (Jinja) in scenario in the following nodes.

Among other use-cases it allows querying 3rd party systems about user properties, coupon codes, etc.

Configure webhook to process response

Switch webhook to “Per customer” mode and select required processing mode from drop down menu.

There are 2 processing options available:

  • Process response as JSON (response will be parsed as JSON)
  • Process response as text (don’t parse the response)

2016-12-12_14h34_37

Using response in Personalization

2016-12-12_14h45_10

You can create an email with a voucher code acquired from a webhook by using following template:

<html>
<head><meta charset="utf-8" /></head>
<body>
Voucher code just for you: {{ webhook.voucher_code }}
</body>
</html>

You can also use the response in “Add event” node to create custom event or set it as customer attribute by using “Set attribute” node.