Webhooks module
Edition | DX Core |
---|---|
License |
|
Issues |
|
Maven site |
|
Latest |
1.0-beta |
The Webhooks module allows you to configure and use webhooks, user-defined callbacks which make REST calls to external APIs, usually to build pipelines.
For an overview about the Webhooks feature in Magnolia, see the Webhooks feature page.
Magnolia Webhooks is a DX Core feature that is currently available as a developer preview. The Webhooks module is provided only for testing purposes in a preproduction beta version.
|
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
<groupId>info.magnolia.webhooks</groupId>
<artifactId>magnolia-webhooks-core</artifactId>
<version>1.0-beta</version>
</dependency>
The module requires at least the following dependencies, which will be included automatically if you use Maven to add the module to your webapp. <dependency> <groupId>io.vavr</groupId> <artifactId>vavr</artifactId> </dependency> <dependency> <groupId>io.github.resilience4j</groupId> <artifactId>resilience4j-core</artifactId> </dependency> <dependency> <groupId>io.github.resilience4j</groupId> <artifactId>resilience4j-retry</artifactId> </dependency> |
Configuration
All webhook definition Yaml files should be placed in the webhooks directory of your light module.
|
Properties
Property name | Description | ||
---|---|---|---|
|
required Name of the webhook. The name must be unique across all webhook definitions. |
||
|
required, if there is no associated REST client referenced through the The URL of the target endpoint that is notified when an event occurs. |
||
|
required, if no associated REST client is referenced. The HTTP method used when Magnolia connects to the target endpoint for an event. Supported methods: |
||
|
optional Key-value map with the parameters to be sent as:
|
||
|
optional Key-value map with the headers to be sent with an HTTP request. Example
|
||
|
required, if the Name of an already existing REST client configuration that will be used when a webhook event occurs. |
||
|
required, if the Name of an already existing REST client call that will be used when a webhook event occurs. |
||
|
required Boolean value which enables or disables the webhook. If |
||
|
required Node with a list of webhook events.
Example
|
||
|
required Name of a webhook event. The name must be unique across all event definitions in the same file. |
||
|
required Type of the webhook event. Two event type values are allowed at the moment,
|
||
|
optional Type of the content. The value can be either |
||
|
optional String that allows you to filter the events. Example
The filter grammar expressions are enclosed in parentheses and can be combined using Filter properties
Filter operators The The |
Example configuration
name: webhook1
url: https://my.server.com/webhookEndpoint
method: GET
queryParameters:
access_token: '2cf09447'
headers:
"Content-Type": "application/json"
"X_Custom_Header": "value"
enabled: true
events:
- name: contentPublished
eventType: Published
filter: "@path LIKE '%foo%' or @nodeType = 'mgnl:page'"
- name: contentUnpublished
eventType: Unpublished
filter: "@path LIKE '%foo2%' or @nodeType = 'mgnl:page'"