Configuring Webhooks
Summary
Webhooks allow for external applications to listen for events that are occurring within EngageIP. They facilitate easier integration with EngageIP and remove the requirement to poll EngageIP's data, providing instant notifications of completed events. They also provide a mechanism to decouple business-specific logic and processes from the inner workings of EngageIP, allowing integrations to be developed in the language and on the platform of choice.
Webhooks Functionality
Webhooks are signals that send out an HTTP request with a payload in a POST operation when events fire at an entity level. When an event occurs, and it is setup as a queueable event, it is added to the webhooks event queue and is eventually processed by the Webhooks. The Webhooks notifies an HTTP endpoint, that is setup to handle the event, that the event has occurred and what entity was acted upon.
Entity Events
Entity Events tell the system what events it should capture when they occur. Whenever an Entity is Created, Updated or Deleted an event is passed through EventLogger.Log(). There, it looks at a cache of the Entity Events table to see if it should process the event or not. If the event should be handled, it creates a new WebhookActivity in the WebhookActivity table.
Note:Ā The dropdowns for entity events will show only if you have your AuditSettings table populated. If its not populated, in order to see the entity events you'll need request that LogiSense support populate the AuditSettings table in your database.
Requirements
The EngageIP Webhook must be running in Windows for Webhooks to function as described above
EngageIP 9.3.2 orĀ earlier:Ā Domain Model Logging must be enabled (found on the Configuration page in EngageIP). This setting does not need to be enabled for systems running EngageIP 9.3.3 or later versions
Webhooks will only fire on objects that have a valid OwnerId or UserId
Configuration
Permissions Required:
In order to perform the configuration steps below the EntityEvent (Add, List)Ā role permissions must be enabled for your EngageIP role. See theĀ Roles - Adding Roles, Setting Role Permissions and ImportingĀ guide for instructions on adding permissions.
Configuration File
The Configuration file for the Webhook can be found in your EngageIP install path (typically C:\Program Files(x86), under the EngageIP\Services path. The file name isĀ WebhookService.exe.config.Ā Within the file you can change the Queue Polling Time (default is every 5 seconds). The polling time value determines how often the Webhook Activity Table is polled.
Note:Ā If the WebhookService.exe.config file is renamed or missing the Queue Polling Time will execute every second.
Creating an Entity Event
In the AdminPortal load on theĀ Setup page
Click onĀ Entity Events
Click theĀ Add button
The Add Entity Event page will load, shown below
Select an Entity (for example UserPackage)
Select an Action (for example Update)
Enter a Description of the Event (optional)
Check Enabled
Click theĀ Save button when finished, orĀ Save/New to add another Entity Event
Registering Webhooks
The Webhooks needs to know what to do with WebhookActivites in queue. Webhook Registrations specify what URI to send the event to.
Load on the SetupĀ page
ClickĀ Webhook Registration
On the Webhook Registration page that loads click theĀ Add button
The Add Webhook Registration page will appear, shown below
Select an Entity/Action to handle
Enter the URI to POST to
Check Is Enabled to Enable the Registration
Check Sends Json to include JSON of the Entity, Action and the Object in the POST request
Click the Save button when finished, or Save/New to add another Webhook Registration
Webhook Activity
A Webhook Activity is a queued event that holds the information about an event that has occurred in the system and the request state. Ā It contains the dates of when the event occurred, when it was last tried and when it will be tried next. Ā It also contains information about the Entity, and the Object that was generated by the event.
Viewing Webhook Activity
Click on Tools
Under the headingĀ Tools and Utilities click onĀ Webhook Activity
A table will display activity on the Webhook Activity page