HTTP Webhook Reference
CosmoEdge supports pushing alarm/event data to an external platform over HTTP. The push configuration is currently maintained through system interfaces, and the event payload fields come from the current event DTO and the packaged HTML interface documentation.
Configuration API
Query:
/gtw/cwai/System/QueryHttpInterfaceParamSet:
/gtw/cwai/System/SetHttpInterfaceParamSet request example:
{
"switch": true,
"url": "http://example.com/cosmo/events"
}Query response example:
{
"resCode": 1,
"resMsg": [],
"resData": {
"enable": true,
"switch": true,
"url": "http://example.com/cosmo/events"
}
}Fields:
| Field | Type | Description |
|---|---|---|
switch | boolean | Whether HTTP push is enabled. |
enable | boolean | Whether HTTP push is enabled; compatibility field in the query response. |
url | string | Receiver URL. |
Event Payload
A typical event payload:
{
"messageId": "MSG-001",
"devId": "DEVICE_SN",
"taskId": "TASK_ID",
"videoChannelId": "CHANNEL_ID",
"channelName": "Entrance Camera",
"timestamp": "1792147200000",
"algorithmId": "ALG_ID",
"algorithmCode": "helmet",
"algorithmName": "Helmet Detection",
"areaId": "AREA_ID",
"areaName": "Work Zone",
"orignalPicture": "/data/event/original.jpg",
"fullPicture": "/data/event/full.jpg",
"detectedPicture": "/data/event/target.jpg",
"video": "/data/event/alarm.mp4",
"videostructured": "/data/event/structured.json",
"overviewFile": "/data/event/overview.json",
"recordId": "RECORD_ID",
"isRetryMessage": false,
"category": "alarm",
"property": {}
}For field details, see API Fields.
Note: The DTO also defines the
itimestampandfilesfields, but the current outboundto_jsonserialization does not emit them, so they are intentionally omitted from the payload above.
Property Object
property changes with the algorithm type. The property categories that can currently be confirmed include:
| Category | Description |
|---|---|
face | Face quality, age, gender, mask, glasses, feature files, and face image. |
body | Body attributes, body features, and body image. |
vehicle | License plate, vehicle color, vehicle type, direction, and vehicle attributes. |
behavior | Behavior count, duration, and target ID. |
machineMaterial | Material/equipment status match result. |
people | People flow statistics. |
car | Vehicle flow statistics. |
workClothesRecognition | Work-clothes recognition match result. |
personCount | Person count. |
countNumber | Count number. |
Additional sub-objects may appear alongside the main categories:
| Sub-object | Description |
|---|---|
recognition | Face-library match result; accompanies face. |
persons | Person target list; accompanies personCount. |
target | Target enter/exit area time and image; optional across types. |
Receiver Recommendations
- The receiver should return
2xxto indicate successful processing. - Use
messageIdorrecordIdfor idempotent processing. - Perform lazy fetching with retry for image, video, and structured file URLs.
- Do not assume all fields in
propertyare present; different algorithms only populate the relevant fields. - The current implementation retains legacy field names such as
orignalPicture; receivers must be tolerant of them.
Packaged HTML Reference
The repository currently retains:
data/Interface/ai-box-interface_v1.0.htmlAfter installation, the entry point is:
web/staticfile/httpInterface.htmlThis HTML can be used as a historical interface reference, but open-source documentation should preferentially rely on the current DTO and Markdown references.
