How do I get my chatbot to trigger a webhook?
Gobot has a built-in webhook functionality that makes it super easy to get your bot to perform actions in third party applications.
You can use a webhook to send information collected by your bot to a third party application. For example, you can automatically post a message to Slack or send dates or numbers collected by your bot to one of your spreadsheets using a webhook.
You can also use a webhook to trigger some action in a third party application. For example, if a visitor engaging with your bot clicks an Unsubscribe button presented by your bot, you can use a webhook to trigger the removal of this visitor from one of your email lists.
Webhooks are extremely useful, which is why we went out of our way to make them really easy to incorporate into your bot scripts. All you really need to do is fill in the webhook URL field and give your webhook a name.
Here's how to include a webhook in your bot:
In Bot Build Mode, drag the Webhook button in your right hand tool palette into your bot script below all of the fields you want sent. Next, in the right hand editor panel, (a) identify which collected fields you want communicated to the third party app, and (b) identify the URL where you want the webhook sent - it’s that easy! When the portion of your bot script containing the webhook is reached your bot will automatically send this information.
The default setting is All Fields, which means that all fields collected by your bot will be sent by your webhook. If you want to change the fields that are sent by your bot, or the field names, you can do so by clicking Choose Particular Fields or Custom. Note that fields collected by your bot later in your script, i.e., fields placed below your webhook in your bot script, will not be sent by your webhook unless you include a second webhook to send those fields.
You can drag a webhook anywhere you want in your bot script. Make sure, however, to first collect the information your webhook will be broadcasting before broadcasting it. For example, if you want your webhook to broadcast your visitor's name or email address for inclusion in a third party app, make sure to include a text or email field in your bot script, collecting your visitor's name or email, before your webhook.
If you are interested in using Zapier, click here.
Note regarding Webhook Testing:
Please note that your bot's webhooks will not be sent in Test Mode - this mode is primarily to help you visualize your bot script flow (not send webhooks or emails). To test your webhook use the Test Webhook button in the bottom of the right hand panel.
The webhook right hand panel also allows for some additional customization of your webhook. For example, you can customize the HTTP method and the header to more securely send batches.
Copyright 2017-2018, Gobot LLC, All rights reserved.