Webhook Payload Structure
Below is an example of a typical webhook Alert payload:
{
"type":"alert",
"subscription_id":"10195028",
"sensor_output_id":"6673",
"sensor_id":null,
"device_serial":null,
"control_id":null,
"ChannelNum":"0",
"trigger_id":242208298,
"created":"2024-07-26 16:20:57",
"message":"The temperature is out of range. This may indicate a food safety issue.",
"alert_engine_id":"57",
"alert_name":"Food Safety Temperature Outside Expected Range",
"condition":"Temperature Out of Range-FS",
"location_id":"2529",
"location_name":"#6439",
"equipment_name":"WIC",
"appliance_id":"194387",
"criticallity":null,
"basicData":[{
"Sensor": {"text":null},
"Maximum Allowed Temperature": {"precision":0,"l10n":"F","value":"90"},
"Minimum Allowed Temperature": {"precision":0,"l10n":"F","value":"90"},
"Actual Average Temperature": {"precision":0,"l10n":"C","value":3.1012307692307695},
"Duration": {"precision":0,"value":"10","l10n":"xlate","unit":"minutes"}
}],
"extraData":null,
"troubleShooting":[
"The electric breaker powering the unit may be off",
"The door may have been left open for a long period of time",
"The automatic door closure device may be broken or disabled",
"The evaporator coil inside the cooler may be frozen over",
"The compressor may have failed or need to be reset"
],
"possibleCauses":[
"Confirm that breakers controlling the equipment are not off.",
"Confirm that the evaporator fans (inside the unit) are spinning and the back of the evaporator is not covered in ice.",
"Confirm that the door is closed and will close automatically.",
"If the breaker is on and the evaporator appears normal and the door is fully closed, but the temp remains high, you will likely need a service technician soon."
]
}
The most useful fields are defined as follows:
location_name
(string): this is the name of the site as it appears in Open Kitchenalert_name
(string): this is the name of the alert class which triggered the messageequipment_name
(string): this is the name of the equipment which triggered the alertcreated
(timestamp): timestamp of when the alert message was generatedtroubleShooting
(array): steps to help root cause the problempossibleCauses
(array): potential reasons why the alert was triggeredtableData
(array): tableData is a means for adding custom values to alert messages (email and text). The data is presented and formatted based on the order of the data returned in the tableData array. There can be multiple tables, e.g. multiple appliance information logged in the alert, and each table we be displayed sequentially in the alert message.Even if there is a single data it must saved as an array of tables .eg. [$tableData] even if it a single table. It must be stored in the resultObject.
The keys of the array indicate the name/description of the element and are automatically translated.
The values of the array are the values which are not translated, but may be converted in the case of different units (F,C) based on locale. Formatting information (e.g., precision) is also presented and then they are formatted to the locale using number_format.
The value of the array is an object which includes the raw value and formatting information.
Below is a sample of an emailed alert message with the corresponding webhook payload components labelled: