improved

Webhooks - Custom header support

✨ Improvement

An additional update to webhooks. It is now possible to add headers (up to 3) to the configuration. These headers will be passed on in each request from the webhook. The idea is to support receiving endpoints behind some basic auth and api-keys.

In the same update we enable key-value labels to be added to the payload. These are meant to support custom metadata to be added to each event posted from the webhooks.

An example event with a label for the region, europe:

{
  "id": "91f7fc45-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "type": "airthings-webhook-cloudevent-sample-feed",
  "source": "accounts.airthings.com/webhooks/17995b45-26e9-47e2-8af7-7267f7d89bc0",
  "dataContentType": "application/json",
  "labels": {"region" : "europe"},
  "data": [
    {
      "serialNumber": "2930001150",
      "recorded": "2019-10-17T12:20:49",
      "radonShortTermAvg": 14,
      "humidity": 56.5,
      "temp": 22.3,
      "co2": 644,
      "pressure": 1010,
      "tvoc": 112
    },
    {
      "serialNumber": "2930001151",
      "recorded": "2019-10-17T12:20:48",
      "radonShortTermAvg": 11,
      "humidity": 56.1,
      "temp": 22.1,
      "co2": 641,
      "pressure": 1011,
      "tvoc": 111
    }
  ],
  "time": "2019-10-17T12:22:53.650000",
  "specVersion": "0.2"
}