Alert format

Service version: 1
Last edit: 2022.09.01

Purpose

This page describes the structure and format of data sent through the Notifications API by Geofencing.

Transition

Data format

Transition data format - JSON
1{
2 "title": "${ALERT_RULE_NAME} - ${ALERT_RULE_UUID}",
3 "body": "'${OBJECT_NAME}' exited '${FENCE_NAME}' on ${DATE} at ${TIME} (UTC).",
4 "contextData": {
5 "eventType": "TRANSITION",
6 "alertId": "uuid_string",
7 "alertName": "name_of_the_alert",
8 "projectId": "uuid_string",
9 "projectName": "name_of_the_project",
10 "fenceId": "uuid_string",
11 "fenceName": "name_of_the_fence",
12 "objectId": "uuid_string",
13 "objectName": "name_of_the_object",
14 "transitionType": "name_of_the_transition",
15 "estimatedTransitionPositionLongitude": double,
16 "estimatedTransitionPositionLatitude": double,
17 "estimatedTransitionTime": "ISO 8601"
18 }
19}

Data fields

The following table describes the fields that are used in a request body.

Primary fields

Field

Description

title
string

The title of the message.
Placeholder values:

  • ${ALERT_RULE_NAME}: The name of the Alert Rule.

  • ${ALERT_RULE_UUID}: The UUID of the Alert Rule.

body
string

The body of the message.
Placeholder values:

  • ${OBJECT_NAME}: The name of the object.

  • ${FENCE_NAME}: The name of the fence.

  • ${DATE}: The date in the format of YYYY-MM-DD when the transition occurred.

  • ${TIME}: The time in the format of hh:mm:ss when the transition occurred.

contextData
object

Contains additional information about a triggered Transition Alert.

contextData object

Field

Description

eventType
string

The type of the event.
Default: TRANSITION

projectId
string

The UUID of the project.

projectName
string

The name of the project.

fenceId
string

The UUID of the fence.

fenceName
string

The name of the fence.

objectId
string

The UUID of the object.

objectName
string

The name of the object.

transitionType
string

The type of the Transition to Alert.
Possible values:

  • "ENTER": When an Object just entered the Fence.

  • "EXIT": When an Object just exited the Fence.

estimatedTransitionPositionLongitude
double

Estimated longitude value of the transition position.

estimatedTransitionPositionLatitude
double

Estimated latitude value of the transition position.

estimatedTransitionTime
string

Estimated transition time as a timestamp (ISO 8601 format).

Examples

Object entered the fence - JSON
1{
2 "title": "Forbidden Area for Drone - 1bc87594-f3da-4031-8786-01a04d145665",
3 "body": "'Drone' entered 'Forbidden Area' on 2021-01-20 at 14:23:21 (UTC).",
4 "contextData": {
5 "eventType": "TRANSITION",
6 "alertId": "1bc87594-f3da-4031-8786-01a04d145665",
7 "alertName": "Forbidden Area for Drone",
8 "projectId": "7083d404-b6b2-4b7d-a876-e5f8aee6f842",
9 "projectName": "Forbidden Areas for Drones",
10 "fenceId": "aa7ace6b-cf04-40fa-8b8f-c98c37a27613",
11 "fenceName": "Forbidden Area",
12 "objectId": "5d631d54-793d-48f1-961f-17949ba6bf6d",
13 "objectName": "Drone",
14 "transitionType": "ENTER",
15 "estimatedTransitionPositionLongitude": 18.2,
16 "estimatedTransitionPositionLatitude": 51.9,
17 "estimatedTransitionTime": "2021-01-20T14:23:21"
18 }
19}
Object exited the fence - JSON
1{
2 "title": "Forbidden Area for Drone - 1bc87594-f3da-4031-8786-01a04d145665",
3 "body": "'Drone' exited 'Forbidden Area' on 2021-01-20 at 14:23:21 (UTC).",
4 "contextData": {
5 "eventType": "TRANSITION",
6 "alertId": "1bc87594-f3da-4031-8786-01a04d145665",
7 "alertName": "Forbidden Area for Drone",
8 "projectId": "7083d404-b6b2-4b7d-a876-e5f8aee6f842",
9 "projectName": "Forbidden Areas for Drones",
10 "fenceId": "aa7ace6b-cf04-40fa-8b8f-c98c37a27613",
11 "fenceName": "Forbidden Area",
12 "objectId": "5d631d54-793d-48f1-961f-17949ba6bf6d",
13 "objectName": "Drone",
14 "transitionType": "EXIT",
15 "estimatedTransitionPositionLongitude": 18.2,
16 "estimatedTransitionPositionLatitude": 51.9,
17 "estimatedTransitionTime": "2021-01-20T14:23:41"
18 }
19}

Dwell

Data format

Dwell data format - JSON
1{
2 "title": "${ALERT_RULE_NAME} - ${ALERT_RULE_UUID}",
3 "body": "On ${DATE} at ${TIME} (UTC) '${OBJECT_NAME}' stayed in '${FENCE_NAME}' ${HOURS} hour(s) ${MINUTES} minute(s) ${SECONDS} second(s) over the limit of ${DWELL_LIMIT_SECONDS} second(s).",
4 "contextData": {
5 "eventType": "DWELL",
6 "alertId": "uuid_string",
7 "alertName": "name_of_the_alert",
8 "projectId": "uuid_string",
9 "projectName": "name_of_the_project",
10 "fenceId": "uuid_string",
11 "fenceName": "name_of_the_fence",
12 "objectId": "uuid_string",
13 "objectName": "name_of_the_object",
14 "estimatedDwellTime": integer,
15 }
16}

Data fields

The following table describes the fields that are used in a request body.

Primary fields

Field

Description

title
string

The title of the message.
Placeholder values:

  • ${ALERT_RULE_NAME}: The name of the Alert Rule.

  • ${ALERT_RULE_UUID}: The UUID of the Alert Rule.

body
string

The body of the message.
Placeholder values:

  • ${DATE}: The date in the format of YYYY-MM-DD when the transition occurred.

  • ${TIME}: The time in the format of hh:mm:ss when the transition occurred.

  • ${OBJECT_NAME}: The name of the object.

  • ${FENCE_NAME}: The name of the fence.

  • ${HOURS}: Hours of being inside a fence.

  • ${MINUTES}: Minutes of being inside a fence.

  • ${SECONDS}: Seconds of being inside a fence.

  • ${DWELL_LIMIT_SECONDS}: Maximum time (in seconds) that an Object could stay inside a Fence before an Alert was raised.

contextData
object

Contains additional information about a triggered Transition Alert.

contextData object

Field

Description

eventType
string

The type of the event.
Default: DWELL.

projectId
string

The UUID of the project.

projectName
string

The name of the project.

fenceId
string

The UUID of the fence.

fenceName
string

The name of the fence.

objectId
string

The UUID of the object.

objectName
string

The name of the object.

estimatedDwellTime
integer

Estimated dwell time of an Object in a Fence.

Example

Object dwell time in the fence - JSON
1{
2 "title": "Forbidden Area for Car - 41a52ea0-259b-4cca-9028-f64525469774",
3 "body": "On 2021-01-21 at 07:34:50 (UTC) 'Car' stayed in 'Forbidden Car Area' 16 hour(s) 42 minute(s) 44 second(s) over the limit of 1 second(s)",
4 "contextData": {
5 "eventType": "DWELL",
6 "alertId": "41a52ea0-259b-4cca-9028-f64525469774",
7 "alertName": "Forbidden Area for Car",
8 "projectId": "d0d65b63-1121-432c-a034-960540df98fa",
9 "projectName": "Forbidden Areas for Drones",
10 "fenceId": "3b895abb-bd54-4f02-bc4e-59e809f0fc3d",
11 "fenceName": "Forbidden Car Area",
12 "objectId": "fd6f935f-00d4-4650-b540-de9d674ffb70",
13 "objectName": "Car",
14 "estimatedDwellTime": 60121
15 }
16}

Object Count

Data format

Object count data format - JSON"
1{
2 "title": "${ALERT_RULE_NAME} - ${ALERT_RULE_UUID}",
3 "body": "The maximum number of objects was exceeded (number of objects:${OBJECT_COUNT}, limit:${OBJECT_COUNT_LIMIT}) in the fence '${FENCE_NAME}' ('${FENCE_ID}') on ${DATE} at ${TIME} (UTC).",
4 "contextData": {
5 "eventType": "OBJECT_COUNT",
6 "alertId": "uuid_string",
7 "alertName": "name_of_the_alert",
8 "projectId": "uuid_string",
9 "projectName": "name_of_the_project",
10 "fenceId": "uuid_string",
11 "fenceName": "name_of_the_fence",
12 "objectCount": integer,
13 "maxObjectCount": integer,
14 "estimatedEventTime": integer
15 }
16}

Data fields

The following table describes the fields that are used in a request body.

Primary fields

Field

Description

title
string

The title of the message.
Placeholder values:

  • ${ALERT_RULE_NAME}: The name of the Alert Rule.

  • ${ALERT_RULE_UUID}: The UUID of the Alert Rule.

body
string

The body of the message.
Placeholder values:

  • ${OBJECT_COUNT}: Number of Objects in a Fence.

  • ${OBJECT_COUNT_LIMIT}: Object count limit that triggered an Alert.

  • ${FENCE_NAME}: The name of the fence.

  • ${FENCE_ID}: The id of the fence.

  • ${DATE}: The date in the format of YYYY-MM-DD when the transition occurred.

  • ${TIME}: The time in the format of hh:mm:ss when the transition occurred.

contextData
object

Contains additional information about a triggered Transition Alert.

contextData object

Field

Description

eventType
string

The type of the event.
Default: OBJECT_COUNT

projectId
string

The UUID of the project.

projectName
string

The name of the project.

fenceId
string

The UUID of the fence.

fenceName
string

The name of the fence.

objectCount
integer

Number of Objects in a Fence.

maxObjectCount
integer

Maximum number of Objects that could be present in a Fence all at once before an Alert was raised.

estimatedEventTime
string

Estimated event time as a timestamp (ISO 8601 format).

Example

Object count in the fence - JSON
1{
2 "title": "Maximum allowed objects inside - 8348f466-3cc2-423b-a34a-0273bd5f7294",
3 "body": "The maximum number of objects was exceeded (number of objects:1, limit:0) in the fence 'Car Park' ('93fd020e-5abd-4613-938b-4ca7f1171499') on 2021-01-20 at 23:53:49 (UTC)",
4 "contextData": {
5 "eventType": "OBJECT_COUNT",
6 "alertId": "8348f466-3cc2-423b-a34a-0273bd5f7294",
7 "alertName": "Maximum allowed objects inside",
8 "projectId": "7083d404-b6b2-4b7d-a876-e5f8aee6f842",
9 "projectName": "Forbidden Areas for Drones",
10 "fenceId": "93fd020e-5abd-4613-938b-4ca7f1171499",
11 "fenceName": "Car Park",
12 "objectCount": 1,
13 "maxObjectCount": 0,
14 "estimatedEventTime": "2021-01-20T23:53:49"
15 }
16}

Proximity

Data format

Proximity data format - JSON
1{
2 "title": "${ALERT_RULE_NAME} - ${ALERT_RULE_UUID}",
3 "body": "'${OBJECT_NAME}' was within proximity distance of ${DISTANCE} meters (${DISTANCE} to fence '${FENCE_NAME}') on ${DATE} at ${TIME} (UTC).",
4 "contextData": {
5 "eventType": "PROXIMITY",
6 "alertId": "uuid_string",
7 "alertName": "name_of_the_alert",
8 "projectId": "uuid_string",
9 "projectName": "name_of_the_project",
10 "fenceId": "uuid_string",
11 "fenceName": "name_of_the_fence",
12 "objectId": "uuid_string",
13 "objectName": "name_of_the_object",
14 "proximityDistance": double,
15 "proximitySide": "proximity_side"
16 }
17}

Data fields

The following table describes the fields that are used in a request body.

Primary fields

Field

Description

title
string

The title of the message.
Placeholder values:

  • ${ALERT_RULE_NAME}: The name of the Alert Rule.

  • ${ALERT_RULE_UUID}: The UUID of the Alert Rule.

body
string

The body of the message.
Placeholder values:

  • ${OBJECT_NAME}: The name of the object.

  • ${DISTANCE}: The distance to the nearest point on the border of the fence.

  • ${FENCE_NAME}: The name of the fence.

  • ${DATE}: The date in the format of YYYY-MM-DD when the transition occurred.

  • ${TIME}: The time in the format of hh:mm:ss when the transition occurred.

contextData
object

Contains additional information about a triggered Transition Alert.

contextData object

Field

Description

eventType
string

The type of the event.
Default: PROXIMITY.

projectId
string

The UUID of the project.

projectName
string

The name of the project.

fenceId
string

The UUID of the fence.

fenceName
string

The name of the fence.

objectId
string

The UUID of the object.

objectName
string

The name of the object.

proximityDistance
double

Distance from the fence within which the alarm was triggered. The value is expressed in meters.

proximitySide
string

Side of the fence in which the proximity will be measured.
Possible values:

  • "INSIDE": When proximity is measured inside a Fence.

  • "OUTSIDE": When proximity is measured outside a Fence.

This field exists for the "PROXIMITY" Alert type.

Examples

Object is within the outside proximity area of the fence.

Object within the outside proximity area of the fence - JSON
1{
2 "title": "Proximity Area Alert - d8a7d15e-9ae6-49f3-9408-30b8ecbeecaf",
3 "body": "'Drone' was within proximity distance of 50 meters (55.7 to fence 'Forbidden Area #1') on 2021-01-20 at 14:23:32 (UTC).",
4 "contextData": {
5 "eventType": "PROXIMITY",
6 "alertId": "d8a7d15e-9ae6-49f3-9408-30b8ecbeecaf",
7 "alertName": "Forbidden Area Alert",
8 "projectId": "b9615d31-de4c-4f55-acfa-9684a2411811",
9 "projectName": "Forbidden Areas",
10 "fenceId": "f9b7f28c-d36a-4461-af15-7697d402e3d7",
11 "fenceName": "Forbidden Area #1",
12 "objectId": "2e5567eb-85bb-4722-900e-5fe83dbe0f19",
13 "objectName": "Drone",
14 "proximityDistance": 55.7,
15 "proximitySide": "OUTSIDE"
16 }
17}

Object is within the inside proximity area of the fence.

Object within the inside proximity area of the fence - JSON
1{
2 "title": "Proximity Area Alert - d8a7d15e-9ae6-49f3-9408-30b8ecbeecaf",
3 "body": "'Drone' was within proximity distance of 34 meters (34.8 to fence 'Forbidden Area #1') on 2021-01-20 at 14:23:42 (UTC).",
4 "contextData": {
5 "eventType": "PROXIMITY",
6 "alertId": "d8a7d15e-9ae6-49f3-9408-30b8ecbeecaf",
7 "alertName": "Forbidden Area Alert",
8 "projectId": "b9615d31-de4c-4f55-acfa-9684a2411811",
9 "projectName": "Forbidden Areas",
10 "fenceId": "f9b7f28c-d36a-4461-af15-7697d402e3d7",
11 "fenceName": "Forbidden Area #1",
12 "objectId": "2e5567eb-85bb-4722-900e-5fe83dbe0f19",
13 "objectName": "Drone",
14 "proximityDistance": 34.8,
15 "proximitySide": "INSIDE"
16 }
17}