The Webhook integration allows you to receive callbacks triggered by updates within Kairos data, alerts and information. Note: This integration provides both sensor reading events as well as alert events.
Creating a Webhook
- Log into your account at app.kairoswater.io.
- From the upper-right of the screen, select Integrations, then select Webhook at the top of the page.
- From the lower-right of the screen, select Connect Webhook.
- Enter the following information:
- Name: Enter a unique, descriptive name for this integration.
- URL: Enter the HTTP-Endpoint to be called in when a device is updated.
- Event Subscriptions: Select which events will trigger the webhook, alerts and/or uplinks.
- Device Subscriptions: Select as many devices from your account as you would like to send updates.
- Data Fields: These filters are not available yet.
- Be sure to select Save Webhook from the lower-right of the screen before leaving the page.
Once saved, you will see a list of integrations from the My Integrations link at the upper-right corner of the Integrations page that lists all available integrations.
From this page you can:
- Edit the fields of your integrations
- Toggle integrations on/off. Disabling the integration will stop new data from being sent to the webhook.
Verifying the Integration
You can verify the integration is working by waiting for, or manually triggering, an event. As soon as a new event occurs, the webhook will be notified and include the event payload. You may consider using a service like RequestBin to verify the data being sent.
Example Payloads
Uplink:
{
"event_type": "uplink",
"event_data": {
"device_id": "acfa9820-f7ca-11ea-9f13-d1d0271289a6",
"user_id": "67d4bff0-2706-4486-b428-5773d458a8de",
"payload": [
{
"name": "Leak",
"sensor_id": "ad292230-f7ca-11ea-9f13-d1d0271289a6",
"type": "waterleak",
"unit": "d",
"value": 0,
"channel": 74,
"timestamp": 1601925407899
},
{
"name": "Temperature",
"sensor_id": "ad2f15a0-f7ca-11ea-bf5c-d11ce3dbc1cb",
"type": "temp",
"unit": "f",
"value": 68.7,
"channel": 3,
"timestamp": 1601925407899
},
{
"name": "Tamper",
"sensor_id": "ad28d410-f7ca-11ea-9621-a51b22d5dc1d",
"type": "digital_sensor",
"unit": "d",
"value": 0,
"channel": 113,
"timestamp": 1601925407899
},
{
"name": "Battery",
"sensor_id": "ad277480-f7ca-11ea-9c71-c517ac227ea5",
"type": "batt",
"unit": "p",
"value": 100,
"channel": 5,
"timestamp": 1601925407899
},
{
"name": "RSSI",
"sensor_id": "ad2307b0-f7ca-11ea-8ae3-2ffdc909c57b",
"type": "rssi",
"unit": "dbm",
"value": -45,
"channel": 100,
"timestamp": 1601925407899
},
{
"name": "SNR",
"sensor_id": "",
"type": "snr",
"unit": "db",
"value": 10,
"channel": 101,
"timestamp": 1601925407899
}
],
"client_id": "1c873ee0-b411-11e9-aaa2-276056e373b7",
"hardware_id": "0000000000c3ea89",
"timestamp": 1601925407899,
"application_id": "kairosiot",
"device_type_id": "844a5810-1df1-11ea-b4cf-f9b17a614a0b"
},
"company": {
"id": 1111,
"address": "1234 Anytown Blvd",
"city": "Anytown",
"country": "United States",
"created_at": "2019-09-20T18:57:52Z",
"industry": "[\"Consumer Electronics\"]",
"latitude": 36.0161,
"longitude": -114.7377,
"name": "",
"state": "Arizona",
"status": 0,
"timezone": "America/Phoenix",
"updated_at": "2019-10-31T16:49:25Z",
"user_id": "67d4bff0-2706-4486-b428-5773d458a8de",
"zip": "86445"
},
"location": {
"id": 1111,
"address": "1234 Anystreet Blvd",
"city": "Anytown",
"country": "United States",
"created_at": "2019-09-20T18:57:52Z",
"industry": "[\"Consumer Electronics\"]",
"latitude": 36.0161,
"longitude": -114.7377,
"name": "Test Facility",
"state": "Arizona",
"status": 0,
"timezone": "America/Phoenix",
"updated_at": "2020-06-14T19:59:21Z",
"user_id": "67d4bff0-2706-4486-b428-5773d458a8de",
"zip": "86445",
"company_id": 0000
},
"device_type": {
"id": "844a5810-1df1-11ea-b4cf-f9b17a614a0b",
"application_id": "",
"category": "module",
"codec": "lorawan.kairos.noahleak",
"data_type": "",
"description": "Water Leak Sensor",
"manufacturer": "Kairos",
"model": "Noah",
"name": "Kairos Noah Leak Detection Unit",
"parent_constraint": "NOT_ALLOWED",
"proxy_handler": "PrometheusClient",
"subcategory": "lora",
"transport_protocol": "lorawan",
"version": "",
"created_at": "2019-12-13T21:42:53Z",
"updated_at": "2019-12-13T21:42:53Z"
},
"device": {
"id": 000000,
"thing_name": "Sample",
"created_at": "2020-09-16T03:14:05Z",
"updated_at": "2020-09-16T03:14:05Z",
"status": 0
}
}
Alerts:
{
"event_type": "alert",
"event_data": {
"userId": "67d4bff0-2706-4486-b428-5773d458a8de",
"applicationId": "kairosiot",
"clientId": "1c873ee0-b411-11e9-aaa2-276056e373b7",
"thingId": "acfa9820-f7ca-11ea-9f13-d1d0271289a6",
"sensorId": "ad28d410-f7ca-11ea-9621-a51b22d5dc1d",
"ruleId": "5f7bcdfc226da0138dfec269",
"eventType": "alert-state-changed",
"totalTriggered": 1,
"hardwareId": "0000000000c3ea89",
"triggered": true,
"value": 1,
"timestamp": "1601949188143",
"triggerData": {
"delay": {
"count": 1,
"time": 600000
},
"location": {
"lat": 36.0161,
"lon": -114.7377,
"ts": "1601949188143"
},
"trigger_reading": 1,
"trigger_type": "trigger",
"trigger_unit": "d",
"triggers": [
{
"conditions": [
{
"operator": "eq",
"value": 1
}
],
"trigger_reading": 1,
"trigger_unit": "d",
"triggers_combination": "OR"
}
],
"triggers_combination": "OR"
},
"title": "Sample Tamper Alert"
},
"company": {
"id": 0000,
"address": "123 Anystreet Blvd",
"city": "Anytown",
"country": "United States",
"created_at": "2019-09-20T18:57:52Z",
"industry": "[\"Consumer Electronics\"]",
"latitude": 36.0161,
"longitude": -114.7377,
"name": "Test Facility",
"state": "Arizona",
"status": 0,
"timezone": "America/Phoenix",
"updated_at": "2019-10-31T16:49:25Z",
"user_id": "67d4bff0-2706-4486-b428-5773d458a8de",
"zip": "86445"
},
"location": {
"id": 0000,
"address": "123 Anystreet Blvd",
"city": "Anytown",
"country": "United States",
"created_at": "2019-09-20T18:57:52Z",
"industry": "[\"Consumer Electronics\"]",
"latitude": 36.0161,
"longitude": -114.7377,
"name": "Test Facility",
"state": "Arizona",
"status": 0,
"timezone": "America/Phoenix",
"updated_at": "2020-06-14T19:59:21Z",
"user_id": "67d4bff0-2706-4486-b428-5773d458a8de",
"zip": "86445",
"company_id": 0000
},
"device_type": {
"id": "844a5810-1df1-11ea-b4cf-f9b17a614a0b",
"application_id": "",
"category": "module",
"codec": "lorawan.kairos.noahleak",
"data_type": "",
"description": "Water Leak Sensor",
"manufacturer": "Kairos",
"model": "Noah",
"name": "Kairos Noah Leak Detection Unit",
"parent_constraint": "NOT_ALLOWED",
"proxy_handler": "PrometheusClient",
"subcategory": "lora",
"transport_protocol": "lorawan",
"version": "",
"created_at": "2019-12-13T21:42:53Z",
"updated_at": "2019-12-13T21:42:53Z"
},
"device": {
"id": 000000,
"thing_name": "Sample",
"created_at": "2020-09-16T03:14:05Z",
"updated_at": "2020-09-16T03:14:05Z",
"status": 0
}
}
Comments
0 comments
Please sign in to leave a comment.