Outgoing Webhooks allow you to connect data and events coming from Datacake to other systems.
Last updated
What are webhooks
A webhook pushes real-time notifications from Datacake to your app. Datacake uses HTTPS to send these notifications to your app as a JSON payload. You can then use these notifications to execute actions in your backend systems.
Use cases
Sync device measurements to your system
You can create a webhook that listens to "measurement recorded" events and stores them in your external database.
Act on raw data from payload decoders
Sometimes, payload decoders return more data than is stored in the time-series database. You can use webhooks to trigger actions based on this information, without paying for storage.
Get started
You can find the Webhooks settings in the "Integrations" section.
Get started by clicking the "Add Webhook" button. You will be presented with a form that asks for the following information:
Endpoint URL -> The URL that receives the events. One good service for testing is https://webhook.site/
Description -> An optional description
Events to send -> You can choose which events should trigger the webhook
Enter your data and click "Create Webhook". Your endpoint should now start receiving data.
Events
In the settings of your outgoing webhook, you can define one or more events that will trigger the webhook and forward data. Learn more about what the differences are and why you want to use them.
Decoder output
This is the raw output from a device payload decoder as can also be seen in a device debug view, including:
Decoder returned data
Console Log
Device Information (LoRaWAN or Particle device types)
Usually, decoders on Datacake return an array of dictionaries where each dictionary holds the measurement information, device serial (not on LoRaWAN and Particle devices), and the field identifier.
However, as the outgoing webhook does transport any information coming from a decoder you could also include additional information here that is not readable for the Datacake backend but can be used by your systems.
Device measurements
This event type is triggered only on new measurement values recorded on the database. This does not necessarily contain all the data of all fields on a device as it only holds the fields that are being inserted on the last message received by your device.
So if your device does receive a single field message per MQTT for example, this only contains the latest field data.
This event is triggered whenever a downlink is sent to a LoRaWAN or MQTT device. It will trigger both on manual and automatic (via rules) downlinks. The structure is as follows: