Webhook Functions

  • Updated

The following hashing functions are supported by string substitution in the body of a webhook (content area), not the headers.

  • sha1
  • sha256
  • sha 512

In addition, users can use the following casing functions for their text

  • lower
  • upper

These must be used exactly as above. Trying to use ‘Sha1’ or ‘UPPER’ will not work. Other functions that are currently unsupported will be ignored, such as the hashing function ‘md5’.

The functions can be nested if it makes sense to do so, such as ‘sha1(lower( … ))’.

Here’s an example of JSON body content for a Teams webhook. The customer’s own webhook may require a different JSON structure, or may even use a different format such as XML.

Note that text must be quoted. Replacements such as {{dsarDetails.email}} do not need quotes around them. (See below).

{  "type": "message",  "attachments": [  {  "contentType": "application/vnd.microsoft.card.adaptive",  "content": {  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",  "type": "AdaptiveCard",  "version": "1.5",  "body": [  {  "type": "TextBlock",  "text": "1. Replaced Hashed Email: sha1({{dsarDetails.email}})\r2. Replaced Upper Email: upper({{dsarDetails.email}})\r3. Lower Text: lower('Text')\r4. Hashed Text: sha256('text')",  "wrap": true  }  ]  }  }  ] }

The result would be something like this, in which the data was hashed and then sent to the webhook URL:

webhookresult.png

Related to