Overview
WebHooks give developers an option to implement custom logic that can communicate with other web applications in two ways:
- Outbound: An event happens on Facebook Messenger (e.g. message arrived) > WebHook > Run Decisions Flow
- Inbound: An event happens in Decisions (e.g. assignment complete) > WebHook > External HTTP request
WebHooks are unlike API calls in the manner that API calls are request-based output mechanisms while WebHooks are event-based.
Example
- Navigate to System > Integrations > WebHooks to create and manage WebHooks.
- There are a few WebHooks that have been pre-loaded for users and trigger automatically when the proper event happens.
- Assignment Created
- Assignment Complete
- Select Create WebHookto begin.
- Define the following settings; these will be inputs on the WebHook step that will be available in the Flow Designer.
- Name
- Enabled
- Data Definitions
- After creating a WebHook, open the Action Menu.
- Here, there are the options to Create WebHook Action, Edit, and View Request Data.
- Selecting View Request Data will show the Data Definitions that were created while creating the WebHook and the Event Name and Date.
Create WebHook Action
A WebHook Action defines what the WebHook will do.
- To create a Webhook Action, in the WebHook action menu select Create WebHook Action and specify the following fields.
- Name
- URL
- Request Type
- Headers
- Additional Data
- Content-Type for POST is application/JSON format. The URL for this example was generated using a WebHook test site.
- After creating a WebHook Action, it becomes available in the WebHook Folder.
- The Action Menu allows designers to Delete, Edit, Test, and View Requested Data.
- When the WebHook Test is run, the WebHook test site immediately updates showing the request details.
Run WebHook by Flow Step
- WebHooks are registered as Flow steps under Integration > WebHooks to allow them to be triggered in a Flow.
- See that the Data Definitions defined earlier are available on this step.
Integration Activity
Outbound WebHook activity can be seen on the Integration Activities report found under System > Administration > System Tools > Flow Management.
Expose Flow as a WebHook
Flows can be exposed as WebHooks.
- Select View Integration Details in the Flow Designer to see the information on how a Flow can be triggered.
- For this example, Postman was used to trigger the WebHook.