Webhook plug-in structure
In this topic you can find information about configuring Webhook event sources and Webhook event conditions.
Configuring a Webhook event source
There are three different types of configuration for event sources that receive
Webhook events:
-
- Generic HMAC
- When configuring a Generic HMAC type event source, you need to
specify the following parameters:
- Secret
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required
- isPassword
- Algorithm
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required
- HeaderName
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required
- IPNetMask
-
- Type: list
- minlength: 1
- maxlength: 1000
-
- Generic
- When configuring a Generic type event source you can specify:
- IPNetMask
-
- Type: list
- minlength: 1
- maxlength: 1000
-
- Github
- When configuring a Github type event source, you need to specify
the following mandatory parameter:
- Secret
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required
- isPassword
- IPNetMask
-
- Type: list
- minlength: 1
- maxlength: 1000
Example
The following is an example of a generic type event source configured to receive
Webhook events:
$eventsource
EVENT_SOURCE /WEBHOOK1
DESCRIPTION "Webhook testing"
PLUGIN Webhook
TYPE GenericHMAC
CONFIGURATION {
"secret": "secretvalue",
"algorithm": "SHA-256",
"headerName": "headerNamevalue",
"ipNetMask": ["xxx.xxx.x.x/xx"]
}
ENDConfiguring a Webhook event condition
WebhookEvent type event conditions can be configured in workflows specifying
the following required properties:
- NameRestriction: If you want to start the event condition name with the prefix "in", ensure that the name is enclosed within double quotes.
- Type
- Event source
Note: When defining event conditions, all the relative
fields are case insensitive
You can also specify any number of
properties that filter the events received from the event source:- Method
- Type: string
- Operator:
EQ("=")orNE("!=") - minlength: 1
- maxlength: false
- Wildcard allowed: false
- Multiple filters: true
- Single predicate: false
- Case sensitive: false
- Values: you can choose one or more:
POSTGETDELETEPUTOPTIONSHEADCONNECTPATCHTRACE
- Headers
- Type: map
- Operator:
KEY_VALUE("keyvalue") - minlength: 1
- maxlength: 1000
- Wildcard allowed: true
- Multiple filters: false
- Single predicate: false
- Case sensitive: false
- Values: {HeaderName[,Headervalue]}
- Parameters
- Type: map
- Operator:
KEY_VALUE("keyvalue") - minlength: 1
- maxlength: 1000
- Wildcard allowed: true
- Multiple filters: false
- Single predicate: false
- Case sensitive: false
- Values: {ParamName[,Paramvalue]}
- ContentType
- Type: string
- Operator:
EQ("=")orNE("!=") - minlength: 1
- maxlength: false
- Wildcard allowed: true
- Multiple filters: true
- Single predicate: false
- Case sensitive: false
- Values: application/json
- Body
- Type: json
- Operator:
JSONATA("jsonata") - minlength: 1
- maxlength: 1000
- Wildcard allowed: false
- Multiple filters: false
- Single predicate: true
- Case sensitive: false
- Values: jsonataExpression
Example
The following is an example of a workflow with three
Webhook event conditions:
$jobstream
WORKFLOW /WS_AGT_1#/WF_EVT_TRIGGER_WH
DESCRIPTION "Event driven workflow webhook"
TRIGGER TRIGGER1 DESCRIPTION "Sample event trigger" TIMEOUT PT1M CORRELATIONS method CONDITIONS
NAME EC TYPE "Webhook/WebhookEvent" SOURCE /WEBHOOK1 FILTERS method = POST
NAME CC TYPE "Webhook/WebhookEvent" SOURCE /WEBHOOK1 FILTERS headers keyvalue {HEADERNAME,HEADERVALUE}
NAME CE TYPE "Webhook/WebhookEvent" SOURCE /WEBHOOK1 FILTERS body jsonata $.test.testing[0].tested
ENDTRIGGER
:
END