Webhook Templates

Webhook templates define a webhook integration that is not created (yet). Templates allows for using common values for many webhooks, such as a common base URLs.

Webhook templates are primarily targeted at service providers who want to create specialized webhook integrations for the users of The Things Enterprise Stack .

Typical use cases

  1. Create a webhook with a personalized base URL, format and message paths.
  2. Provide users with additional information about the webhook itself, using documentation and visual aids.
  3. Simplify the process of enabling the integration by removing the manual work of the user.

How does it work?

Webhook templates can be used to pre fill the common values of a webhook integration such as the base URL, the message paths or the provided headers. They also allow input from the user, in the form of fillable fields, which are then replaced in the template by the Console in order to obtain the concrete webhook.

See Template Format for more information on the contents of a webhook template and Template Instantiation for more information of the process through which a webhook template, with user input, is converted into a webhook integration.

Format

Webhook templates are described using the YAML language. Their format is very closely related to that of a normal webhook integration, but with additional fields added.

Instantiation

The process through which a webhook template becomes a webhook integration is called instantiation. Instantiation is done by the Console after the user has filled in the values of the the template fields. This page describes how the template and the values are combined into the final webhook instance.

Adding Webhook Templates

The Things Enterprise Stack uses webhook templates from the lorawan-webhook-templates Github repository. Once you have created a new webhook template with a proper format, you can easily test it locally by following the next steps: Clone the lorawan-webhook-templates Github repository to a local folder. Store your webhook template in the previously mentioned folder. Include your webhook template in the templates.yml file. Update your The Things Enterprise Stack configuration file by adding the following lines: