Webhook Configuration
Webhook config template
# example-webhook-template.yaml
meta:
name: my-webhook
topic: my-topic
# optional
transforms:
- uses: smartmodule_name
with:
param_name: param_value
# optional
webhook:
outputParts: [body | full (default)]
outputType: [text | json (default)]
outputUri: [none | full (default)]
Config options
Meta
name
- The name of your webhooktopic
- The name of the topic you want events to be stored. It will be automatically created if it doesn't exist.
Transforms
Webhook connectors support transforms
. Records can be modified before they are sent to the topic. The transforms section is a list of transform objects. Each transform object has an uses and a with section.
uses
is the reference to the SmartModule used in the transform.with
is the configuration for the transform- The section is different for each transform
- See the connectors reference documentation for available configuration options
Webhook
The output record from the webhook request is configurable
outputParts
options:
full
- Return the headers and body of the request (Default)body
- Only return the body of the request
outputType
options:
json
- Output is parsed into jsontext
- Output is plaintext (Default)
outputUri
options:
full
- Parse URI path and query parameters into outputnone
- Don't parse path and query parameters into output (Default)path
- Only record path into the outputquery
- Only record query parameters into the output
output behavior
If outputUri
behavior is fully enabled, information from the URI call is encoded in
the webhook records.
A http webhook connection to a URI of https://infinyon.cloud/webhooks/v1/[uri-key]/path1/path2/path3?p1=1¶m2=2
will return path and query information as follows:
- path:
path1/path2/path3
- query:
p1=1¶m2=2
If intending to process URI path
& query
information with Smartmodule
transformations, it is recommended to also configure outputType
to json.
The path and query parameters will be part of the json object and can be
directly operated upon by the Smartmodule.
See the How to Use WebHooks: URI path & query section for an example of the json object.