This section provides instructions for creating a webhook in the console.
In addition to the written instructions linked below, a video with instructions for creating webhooks is available on The Things Network youtube channel.
Creating a webhook requires you to have an HTTP(S) endpoint available. If you don’t have an endpoint available for testing, you can test with a free service like Webhook.site.
In your application select the Webhooks submenu from the Integrations side menu. Clicking on the + Add Webhook button will open the list of Webhook templates.
To use a predefined webhook template, choose it. Otherwise, to create your own custom webhook, choose Custom webhook and follow the instructions below.
Give your webhook a Webhook ID to identify it. Choose JSON as the Webhook format.
For Base URL, provide the upstream endpoint URL that the webhook should call. Make sure to always check if the endpoint is accessible beforehand, using tools like cURL or Postman. The
200 OK status code response must be received from the endpoint URL for a Webhook integration to be successful.
The Downlink API key field allows you to provide an API key which will be sent with all messages to the webhook endpoint. This can be useful to allow your integration to schedule downlinks without requiring you to hardcode an API key in the endpoint.
Note:Your integration may also schedule downlinks using an API key with appropriate rights, regardless of the value in the Downlink API key field.
To enable messages for different types of events, use the checkboxes in the Enabled messages section.
The paths are appended to the Base URL. In the example from the images above, the Application Server will perform
POST requests on the endpoint
https://webhook.site/uplinks for uplinks,
https://webhook.site/join-accept for join-accept messages, and
https://webhook.site/downlink-ack for downlink acknowledgement messages.
If no path is specified, messages of that type will be sent to the Base URL.
See Data Formats for examples of uplink and downlink JSON messages.
Clicking the Add Webhook button will create the Webhook.