Set up a HTTP webhook

Created:
March 13, 2023
Updated:
May 18, 2023

Create a custom webhook.

1. Go to the Integrations tab on the dashboard. Click Create Integration.

2. Select HTTP Webhook.

3. Enter the following details.

  • Name of Integration - Enter a name for the integration.
  • Secret Value - Enter the secret value used to authenticate.
  • Webhook URL - Enter your HTTPS endpoint. This will be where the alert will be posted to.
  • (Optional) Edit the payload if required. This is the text and information that will be populated into the webhook notification when you get an alert. For more information and a list of all tokens, go to Dynamic variables.

4. Click Submit.

Verify the webhook

You can verify the webhook is valid by following the below in python.


import hmac
import hashlib

def verify_webhook(request_body, request_headers, webhook_secret):
    digester = hmac.new(bytes(webhook_secret, 'utf-8'), request_body, hashlib.sha512)
    calculated_signature = digester.hexdigest()
    if calculated_signature != request_headers.get('x-ft-sign', None):
        raise("Invalid webhook signature")
    return True