added

API - Webhook management added

πŸš€ Feature Release

Webhooks can now be created and retrieved using the API.

To create a webhook, use POST /webhooks?organizationId={{organization_id}} with the following example request body:

{
    "name": "My webhook",
    "url": "https://myurl.com",
    "labels": {"key": "value"},
    "headers": { "key": "value" },
    "measurementSystem": "METRIC/US",
    "devices": ["293000000"],
    "locations": ["0aaac9e8-c26b-4141-9177-1105b65736ae"],
    "active": true
}
{
    "name": "My webhook",
    "url": "https://myurl.com",
    "labels": { "key": "value" },
    "headers": { "key": "value" },
    "measurementSystem": "METRIC/US",
    "locations": [
        {
          "id": "591df93d-ec4e-4780-959c-e8c474e29d7a",
          "name": "Oslo",
          "labels": {}
        }
     ],
    "devices": [
       {
          "id": "293000000",
          "deviceType": "WAVE_PLUS",
          "sensors": ["temp"],
          "segment": {
             "id": "017dd064-0ccd-4902-825e-32e7960edd73",
             "name": "Device name",
             "started": "2021-06-03T15:18:56",
             "active": true
          }
       }
    ],
    "active": true,
    "eventTypes": [
       "hub-meta-data-feed",
       "mold-sample-feed",
       "sample-feed",
       "virus-risk-sample-feed"
    ]
}

Note that except name and url, all other parameters in the request body are optional.
See Webhooks for more information.

Use GET /webhooks?organizationId={{organization_id}} to fetch your list of webhooks.