Previously, configuring a webhook for specific locations required manual action and updates whenever a new location was added to an account. Now, you can configure webhooks to subscribe always to all locations in an account. See the sections below for more details.
Dashboard
You can configure webhooks in our dashboard at dashboard.airthings.com/integrations/webhooks:
Previously, the Select all checkbox did not account for new locations added in the future. Now, the Select all option automatically includes new locations as they are added.
API
Our API also enables webhook configuration. We have introduced a new field, subscribedToAll
, which allows a webhook to subscribe to all locations. When this field is set to true
, it is no longer possible to provide specific locations in the request. See our API reference for more information or see this example:
curl --request POST \
--url 'https://ext-api.airthings.com/v1/webhooks?accountId=00000000-0000-0000-0000-0000000000' \
--header 'accept: application/json' \
--header 'authorization: Bearer $AUTH_TOKEN' \
--header 'content-type: application/json' \
--data '
{
"active": true,
"eventTypes": [
"samle-feed"
],
"subscribedToAll": true,
"url": "https://webhook.site/00000000-0000-0000-0000-0000000000",
"name": "My Webhook"
}
'