Webhooks allow you to set up your own integrations to Malcolm! Workflow. Webhooks are endpoints on web servers you own. Whenever a Workflow is completed the configured Webhooks will be notified. The Payload will contain the completed Workflow Session, related Workflow and (optionally) the submitted Workflow Values. Configuration Webhooks are are configured in "Workflows > Edit > Configure > Webhooks" section of MyMalcolm. https://malcolm-en-gb.s3.eu-west-1.amazonaws.com/instances/HwJyEPPI3q/resources/IWqLLH7kgn/Screenshot%202021-01-26%20at%2016.17.46.png (Screenshot 2021-01-26 at 16.17.46.png) Webhook URL The only requirement is to provide the URL of your Webhook. This is the URL Malcolm! will send the Payload to. The URL should be a secure endpoint which means it should start with https://, although we do support http:// too. The endpoint should also be accessible which means hosted on a remote machine, not behind a firewall and not requiring Authentication. Include the Workflow Values There is an additional option to include the submitted Workflow Values in the Payload. This option is disabled by default for security reasons but available to use should you wish to enable it. By enabling the option you agree to the following terms - (a) I would like the Workflow Values included in the Webhook Payload (b) the recieving web server is private and properly secured (c) I am aware the use of Webhooks can facilitate the transfer of end-user personal data to third party Data Processors and my use of Webhooks adheres to my responsibilities as Data Controller under applicable Data Protection Laws. Secure your Webhook with a secret token Webhook URLs can be called by anyone and are therefore insecure. To ensure a request to your Webhook URL comes from Malcolm! a secret token known only by yourself and Malcolm! can be used to generate a Signature. Malcolm! will take the Payload and the secret and create a Signature. This will be passed to your App as the request header X-Signature. Your App will use the same secret and the received Payload to generate a second Signature. If the Signatures match you know the request came from Malcolm! and not another source. The secret token can be any string you like, but Malcolm! recommends using a random string of at least 36 characters. For example in a Terminal window run - To validate the Payload from Malcolm! use the HMAC SHA-256 algorithm to create a hash using the Payload as the data and your secret as the key. For example in PHP use the hash_hmac function to generate a binary hash. Next encode the binary hash using a Base 64 encoder, in PHP this is the base64_encode function. Finally prefix the encoded hash with "sha256=" and compare with the value of X-Signature. In PHP you can use the $_SERVER variable to access the headers. Conditional settings There are conditional controls available too. If you have a condition configured the Webhook will only be notified if the conditions at the end of the Workflow are satisfied. Headers The HTTP POST will contain the following Headers. Payload The Payload will be a JSON Body containing the Workflow Session. Workflows are defined as - Workflow Values are defined as - Workflow Fields are defined as - Example