Alerts

Alert object

Alert object is the backbone of reporting and it keeps all elements of an alert. Alerts can be queried by string parameters and camera. Alert API works with unix timestamp as the start and end time of the queried alerts and those are required for all type of API calls. So it returns alerts, which created in the given time period only.

It is recommended to use frequent API calls by keeping the distance between start and end time, because it is easier to manage less alerts at a time. However there is no limitation on start and end times, it is completely up to your scripting structure.

Sample Alert Object

You can see all elements of the alert object at the json below.

{
"id": "132a53cb-c9c4-9924-2a28-j24d4af93af",
"cameraId": "3b084a37-6fd4-4c1b-beea-eg403217751b",
"name": "STATIC_DELIMITATION_AREA",
"count": 2,
"createdAt": "2020-08-09T11:55:08Z",
"url": "https://images.intenseye.com/e1d2e50a-58f0-4a14-806f-f3968e52810f-1581666181.jpg",
"imageDimensions": {
"width": 1920,
"height": 1080
},
"canvasDimensions": {
"width": 1466,
"height": 895
},
"violatingCoordinates": [
{
"x": 713,
"y": 463
}
],
"area": [
{
"x": 713,
"y": 463
},
{
"x": 854,
"y": 510
},
{
"x": 302,
"y": 181
},
{
"x": 456,
"y": 388
}
],
"storageClass": "s3",
"info": {},
"bookmark": false,
"alertRuleId": "310e824b-2696-4595-af1a-1ce2bbbb41ec",
"localCreatedAt": "2020-08-09T14:55:08Z",
"falsePositive": false
}

Endpoints


Query alerts based on time interval

GET/alerts

Roles:

alerts:read

Arguments

QUERY STRING PARAMETERS
  • start Long required The timestamp where the alerts are happened later
  • end Long required The timestamp where the alerts are happened earlier
  • page Integer Page number to retrieve the alerts. First page includes most recent alerts. (Defaults to 1)
  • count Integer Number of alerts to retrieve. (Defaults to 20)
  • facilityId UUID Id of the facility to filter results
  • cameraId UUID Id of the camera to filter results
  • type String Filter by alert type.
  • severity String Filter by alert severity.
  • bookmark Boolean Filter by bookmark

Returns

Returns a list of alert object for the camera that was provided in the request.

{
"status": "ok",
"data": {
"page": 1,
"count": 10,
"total": 139,
"alerts": [
{
"id": "132a53cb-c9c4-9924-2a28-j24d4af93af",
"cameraId": "3b084a37-6fd4-4c1b-beea-eg403217751b",
"name": "STATIC_DELIMITATION_AREA",
"count": 2,
"createdAt": "2020-08-09T11:55:08Z",
"url": "https://images.intenseye.com/e1d2e50a-58f0-4a14-806f-f3968e52810f-1581666181.jpg",
"imageDimensions": {
"width": 1920,
"height": 1080
},
"canvasDimensions": {
"width": 1466,
"height": 895
},
"violatingCoordinates": [
{
"x": 713,
"y": 463
}
],
"area": [
{
"x": 713,
"y": 463
},
{
"x": 854,
"y": 510
},
{
"x": 302,
"y": 181
},
{
"x": 456,
"y": 388
}
],
"storageClass": "s3",
"info": {},
"bookmark": false,
"alertRuleId": "310e824b-2696-4595-af1a-1ce2bbbb41ec",
"localCreatedAt": "2020-08-09T14:55:08Z",
"falsePositive": false
}]
}
}

Query alerts by camera

GET/cameras/:cameraId/alerts

Roles:

alerts:read

Arguments

QUERY STRING PARAMETERS
  • start Long required The timestamp where the alerts are happened later
  • end Long required The timestamp where the alerts are happened earlier
PATH PARAMETERS
  • :cameraId UUID Id of the camera

Returns

Returns a list of alert object for the camera that was provided in the request.

{
"status": "ok",
"data": {
"page": 1,
"count": 10,
"total": 139,
"alerts": [
{
"id": "132a53cb-c9c4-9924-2a28-j24d4af93af",
"cameraId": "3b084a37-6fd4-4c1b-beea-eg403217751b",
"name": "STATIC_DELIMITATION_AREA",
"count": 2,
"createdAt": "2020-08-09T11:55:08Z",
"url": "https://images.intenseye.com/e1d2e50a-58f0-4a14-806f-f3968e52810f-1581666181.jpg",
"imageDimensions": {
"width": 1920,
"height": 1080
},
"canvasDimensions": {
"width": 1466,
"height": 895
},
"violatingCoordinates": [
{
"x": 713,
"y": 463
}
],
"area": [
{
"x": 713,
"y": 463
},
{
"x": 854,
"y": 510
},
{
"x": 302,
"y": 181
},
{
"x": 456,
"y": 388
}
],
"storageClass": "s3",
"info": {},
"bookmark": false,
"alertRuleId": "310e824b-2696-4595-af1a-1ce2bbbb41ec",
"localCreatedAt": "2020-08-09T14:55:08Z",
"falsePositive": false
}]
}
}

Toggle bookmark for alert by alert id

An alert can be bookmarked and it can be filtered among bookmarked alerts.

PUT/cameras/:cameraId/alerts/:alertId/bookmark

Roles:

alerts:writecameras:readfacilities:read

Arguments

PATH PARAMETERS
  • :cameraId Id of the camera
  • :alertId Id of the alert

Returns

{
"status": "ok",
"message": "Alert bookmark updated"
}

Query alert rule by alert id

The alert rules set on a camera can be queried by camera id.

GET/cameras/:cameraId/alert_rules

Roles:

alert_rules:readcameras:read

Arguments

PATH PARAMETERS
  • :cameraId UUID Id of the camera

Returns

{
"status": "ok",
"data": [
{
"id": "ff0343ef-c2c3-4eed-a64f-4ggbd7035cb5",
"cameraId": "8b084a37-6fr4-4c1b-bsea-ea403917791b",
"severity": "MODERATE",
"name": "UNATTENDED_OBJECT_DETECTION",
"dayRange": [
0,
5,
1,
6,
2,
3,
4
],
"timeRange": [
"2020-07-24T00:00:00Z",
"2020-07-25T00:00:00Z"
],
"emails": [
],
"group": {
"id": "ffac5kc0-675f-417c-95c2-873753h49c61",
"type": "GROUP",
"name": "UNATTENDED_OBJECT_DETECTION",
"children": [
{
"id": "689f9460-d8bc-45e0-z251-af1d00eb5248",
"type": "AREA",
"name": "Area 1",
"children": [
{
"id": "32c84229-b038-4316-91f6-8a281171127a",
"type": "UNATTENDED_OBJECT_DETECTION",
"duration": 60
}
],
"points": [
{
"x": 496,
"y": 495
},
{
"x": 1167,
"y": 397
},
{
"x": 1793,
"y": 1068
},
{
"x": 562,
"y": 1079
}
],
"color": "#f5222d"
}
],
"operator": "AND"
},
"pretty": "AND(ARUnattendedObjectDetection: Duration 60)",
"phoneNumbers": []
}]
}

Get last (simplified) alert in a camera by type

GET/cameras/:cameraId/alerts/last

Arguments

PATH PARAMETERS
  • :cameraId UUID Id of the camera to retrieve
QUERY STRING PARAMETERS
  • alertType String required alert type

Returns

Returns an (simplified) alert object

{
"status": "ok",
"data": {
"id": "9c6a2ef7-6ae3-4324-b7e3-1bbe975f24e2",
"cameraId": "af5dec06-fda4-43f9-8878-2b27e7e3aaf7",
"name": "MIN_WORKER_IN_CONFINED_SPACE",
"createdAt": "2020-11-12T13:51:07Z",
"alertRuleId": "bbb0f794-2e00-4c8e-847c-c2bf55c0b164",
"localCreatedAt": "2020-11-12T16:51:07Z"
}
}