How to Define Triggers for Web Hooks
In web hook is possible to define a match rule to define when the action must be called:
By clicking on the icon shown in the figure, the form for defining the rule opens up.
Can be defined:
-
Name: rule name
-
Description: optional description
-
Resource Type: Blindata resource type
-
Event Type: event type, like creation or modification. If the “none” is selected every type of event will trigger the hook
-
Match Attributes: By clicking on the icon shown in the figure, the form for defining the rule opens up. This allows for defining optional sets of values that the resource must contain in order for the rule to be satisfied. Clicking on the “+ " button opens up the form dedicated to defining the attributes.
The match rule show:
- Name
- Description
- Http method
- Resource type
- Match attributes
- Parameters mapping
In the match attributes section, the mapping between the defined variables and how they should be populated is defined. In particular, we can use:
Field | Description |
---|---|
resourceType | The type of resource in the Blindata system. |
resourceIdentifier | The identifier of the examined resource, particularly useful for deletions or modifications. |
resourceName | The name of the examined resource. |
user | The user who triggered the webhook. |
tenantName | The name of the tenant where the webhook was triggered. |
tenantUuid | The identifier of the tenant where the webhook was triggered. |
tenantSchema | The schema of the tenant where the webhook was triggered. |
eventType | The type of event (e.g., PUT, POST, DELETE) that triggered the webhook. |
payload | The payload of the actual call response. In the example case, it is the JSON response obtained from the creation of the data category (concept). |
These are the fields of the response from the webhook call that can be used to populate the dynamic parameters defined in the body.