Webhooks
Webhooks allow you to receive emails and/or HTTP requests when triggered by events on the Dialogtrail platform.
The triggers include:
SUBSCRIBE
is triggered when a Facebook Messenger user subscribes to your page.UNSUBSCRIBE
is triggered when a Facebook Messenger user unsubscribes from your page.VARIABLE_UPDATED
is triggered when a user sets or updates a variable, you also need to specify which variable(s) you want to listen to.DATA_RECEIVED
is triggered when a messenger user enters their email or phone number.PRODUCT_RECOMMENDATION
is triggered whenever a user receives a product recommendation.1
You may select one or more of the following data as requirements for a webhook to be triggered.
EXTERNAL_ID
(legacy) user id received through out old popupEMAIL
is the user’s email address.TEL
is the user’s phone number.
For example, you may create a webhook triggered by the VARIABLE_UPDATED
trigger but you only want it to be triggered if Dialogtrail has the user’s email address. In order to achieve this, you can set EMAIL
as a requirement.
Enter the target email addresses that the email should be sent to. You may set the subject and content to anything you want including placeholders (see below) or leave them blank for an automatically generated email.
Request
Specify the URL, method and body you want to use, optionally along with authentication. Both the URL and body may include placeholders (see below).
You can test your request by clicking on Done. The request will be sent according to your specification with example placeholder values.
Example URL: https://app.dialogtrail.com/users/{{user_external_email}}/tags
Example Body:
{
"tag_name": "{{variable.name}}",
"tag_value": "{{variable.value}}"
}
Placeholders
Placeholders can be user for both emails (subject and body) and HTTP requests (url and body).
Which placeholders that are available depends on the trigger type.
SUBSCRIBE
, UNSUBSCRIBE
and DATA_RECEIVED
{{user_external_email}}
the user’s email{{user_external_phone}}
the user’s phone number{{user_card_url}}
link to the user’s card on Dialogtrail
VARIABLE_UPDATED
- All above and additionally:
{{variable.name}}
the variable name{{variable.name.no_spaces}}
the variable name without spaces{{variable.value}}
the variable value{{variable.value.no_spaces}}
the variable value without spaces{{variable.value.boolean}}
the variable value as a boolean{{variable.value.integer}}
the variable value as an integer
PRODUCT_RECOMMENDATION
- The three first and additionally:
{{product_ids}}
a JSON array with the product ids (suitable for HTTP request JSON bodies){{product_ids_string}}
a comma separated list of the product ids{{product_guide_id}}
the product guide id{{product_guide_name}}
the product guide name
-
Currently, product recommendation webhooks are sent on every recommendation in the last step for every guide. If your guides receive a lot of traffic, it may be unsuitable to use the email webhook type. ↩