Webhook Intercept

Description

This service serves as an "intercept" between two services that lets you format the data from the first one before sending it to the second. I originally made this because I was annoyed at how difficult it was to send data from one webhook to Discord. IFTTT was horrible to use too and not exactly specialized for this. Currently, this only supports sending & receiving POST application/json data.


How It Works

Here's a basic description of how the service works:
  1. The service receives a payload from the sending service (for example GitKraken)
  2. The service formats a new payload according to a pre-created "form" (of sorts) for the receiving service
  3. The service sends the data to the receiving service (for example Discord)
  4. The service relays any error/responses to the sending service

Notice

This service is provided free of charge and I may remove any created profile for any reason without prior warning. This is a small site and project that is not prepared for extreme amounts of data, as such I must ask that you be respectful of said limitations. I can and will make this private if I find that people are abusing it.

How to format template

The template should contain a valid JSON string which would be forwarded to the receiving service. You can incorporate data received from the sending service by using a placeholder. The placeholder is in the format <<<key>>> (please make sure not to put any whitespace between the braces). You can also use subkeys by formatting it as <<<key.subkey.another_subkey.etc>>>. Valid characters for (sub)keys are alphanumeric characters, dashes, and underscores. Support for lists as a subkey does not currently exist yet.

Here's some example data. Let's say that the service receives the following data from the sending service:
{
  "action": "added",
  "board": {
    "id": "123456",
    "name": "Example"
  },
  "card": {
    "id": "7890",
    "name": "Test",
    "created_date": "2021-09-03T16:20:29.485Z",
    "created_by": {
      "name": "A random person"
    }
  }
}
    
You could do something similar to the following to format it (in this example, as a Discord webhook request):
{
  "username": "Example",
  "content": "Card with ID <<<card.id>>> was <<<action>> to board with ID <<<board.id>>> by <<<card.created_by.name>>>"
}
    

Bug Note

There is a permanent bug that I won't be able to fix, when you use http instead of https as the scheme for the intercept URL, it'll return a 405 - Method Not Allowed error. This is due to HTTPS only being enabled in Cloudflare, which uses a 301/302 redirect to redirect to HTTPS. 301/302 redirects don't redirect with the same method (POST) which causes this error. The only real way for this to be fixed website side is to either use 307 redirects which aren't supported or not have HTTPS enforce, which is obviously a bad idea. As such, make sure you have the scheme as HTTPS in your webhook.