Webhooks allow third-party applications to receive near real-time event notifications from CIM
CIM supports webhooks as a way to allow third-party applications and services to receive near real-time event notifications from CIM.
For example, you can create a Slack App that subscribes to new equipment alerts from CIM and posts them to a specific channel.
Webhooks will be sent in the form of a POST HTTP request to the specified URL when an event like alert created, fault, recovered or updated takes place.
Webhooks are set up per user account across one, many or all sites a given user account has permissions for.
To create a webhook, register the URL within your application that will receive the webhook payload sent when the event is triggered.
Webhook Payload
The format of the webhook payload is in JSON. Here is an example.
{
"alert": {
"site_id": 195,
"summary": "AHU_05 - Inspect Supply Air Loss",
"fault_status": "fault",
"description": "- Unit supply air pressure is constantly below setpoint when operating at max fan speed\n- Rule Trigger: SAP< SAP SP when Status is ON and Fan Speed at max.",
"solution": "1. Confirm pressure setpoint max limit\n2. Check max speed limit on VSD and release\n3. Inspect for fan damage (eg. loose fan belt, duct leak/block)\n4. Check for faulty sensors",
"updated_at": "2022-07-10T23:00:05.703Z",
"created_at": "2022-06-26T23:00:05.730Z",
"last_fault_transitioned_at": "2022-07-10T23:00:05.703Z",
"resolved_at": null,
"rule_id": 242189,
"status_id": 1,
"inbox": true,
"type": "alert",
"ticket_id": "9be97fbe-4249-43a2-adc9-8905b20fe5dc",
"ticket_archived": false,
"equipment_ids": [ 886910746949 ]
},
"changes": [
{
"field_id": "inbox",
"old_value": {
"placeholder_field": "placeholder_value"
},
"new_value": {
"placeholder_field": "placeholder_value"
}
}
],
"event_id": "b45f55c2-0c3c-4163-9973-2a46f198a951",
"event_type": "alert.updated",
"subscription_id": 5
}
Supported Trigger Events
These are the supported trigger events for webhooks.
Alerts
Trigger event | Description |
---|---|
alert.created | Alert created. Alert will be in fault when first created. |
alert.updated | Alert updated. For example, transition between fault and recovered, ignored, closed, linked to an action, marked as seen/ unseen, archived. |
alert.deleted | Alert deleted. |