Notification format

Service version: 1
Last edit: 2022.08.30

Purpose

This page describes the data structure of sent notifications.

Webhook Classic - Request data

HTTPS method: POST

POST request body format

post
POST request body format - JSON
1{
2 "title": "The title of the message",
3 "body": "The body of the message",
4 "contextData": {}
5}

Request fields

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

Primary fields

Description

title


string

The title of the message.


This field is received from the sending service and is sent unchanged.

body


string

The body of the message.


This field is received from the sending service and is sent unchanged.

contextData


object

The object that contains additional data which is provided by a service that sent the notification.

Examples

The message was sent by a Geofencing service to the Notifications API with the following payload.

Message sent by a Geofencing service - 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}

The message will be sent to the receivers group without any changes in the data.

Message sent to the receivers group - 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}

Webhook-Slack - Request data

HTTPS method: POST

POST request body format

post
POST request body format - JSON
1{
2 "text": "*${TITLE}*\n${BODY}"
3}

Request fields

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

Primary fields

Description

text


string

The message format sent to the Slack webhook.


The ${TITLE} placeholder will be replaced with the title and ${BODY} with the message from the classic webhook.

Example

The message was sent by a Geofencing Service to the Notifications API with the following payload.

Message sent by a Geofencing service - 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}

The received data will be formatted to the Slack pattern and sent to the receivers of the Slack group. The ${TITLE} will be replaced with the 'Forbidden Area for Drone - 1bc87594-f3da-4031-8786-01a04d145665' and ${BODY} with the 'Drone' entered 'Forbidden Area' on 2021-01-20 at 14:23:21 (UTC).

message
Message sent to the receivers of the Slack group - JSON
1{
2 "text": "*Forbidden Area for Drone - 1bc87594-f3da-4031-8786-01a04d145665*\n'Drone' entered 'Forbidden Area' on 2021-01-20 at 14:23:21 (UTC)."
3}

The preview of the message can be found at the Messages Builder.

Webhook-Teams - Request data

HTTPS method: POST

POST request body

post
POST request body format - JSON
1{
2 "text": "${TITLE}
3 ${BODY}"
4}

Request fields

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

Primary fields

Description

text


string

The message format sent to the Slack webhook.


The ${TITLE} placeholder will be replaced with the title and ${BODY} with the message from the classic webhook.

Example

The message was sent by a Geofencing Service to the Notifications API with the following payload.

Message sent by a Geofencing service to the Notifications API - 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}

The received data will be formatted to the Teams pattern and sent to the receivers of the Teams group. The ${TITLE} will be replaced with the 'Forbidden Area for Drone - 1bc87594-f3da-4031-8786-01a04d145665' and ${BODY} with the 'Drone' entered 'Forbidden Area' on 2021-01-20 at 14:23:21 (UTC).

message
Received data formatted to the Teams pattern - JSON
1{
2 "text": "Forbidden Area for Drone - 1bc87594-f3da-4031-8786-01a04d145665
3 'Drone' entered 'Forbidden Area' on 2021-01-20 at 14:23:21 (UTC)."
4}

E-mail - Data format

E-mail format

Subject field in the e-mail.

${TITLE}

The body of the e-mail.

email
Example email body
1Hi!
2We noticed that ${BODY}
3Best Regards,
4> TomTom Notifications / svc_lns_notifications@tomtom.com / www.tomtom.com

Request fields

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

Primary fields

Description

${TITLE}


string

The subject format sent in the e-mail body.


The ${TITLE} placeholder will be replaced with the title from the classic webhook.

${BODY}


string

The body format sent in the e-mail body.


The ${BODY} placeholder will be replaced with the body from the classic webhook.

Example

Send a message from the Geofencing service to the Notifications API with the following payload

Message sent by a Geofencing service to the Notifications API - 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}

The received data will be formatted to the E-mail pattern and sent to the receivers of the E-mails group. The ${TITLE} will be replaced with the 'Forbidden Area for 'Drone' - 1bc87594-f3da-4031-8786-01a04d145665' and ${BODY} with the 'Drone entered 'Forbidden Area' on 2021-01-20 at 14:23:21 (UTC)'.

Subject field in the e-mail

message
Subject field in the e-mail example
Forbidden Area for Drone - 1bc87594-f3da-4031-8786-01a04d145665

The body of the e-mail

message
Email body example
1Hi!
2We noticed that 'Drone' entered 'Forbidden Area' on 2021-01-20 at 14:23:21 (UTC).
3Best Regards,
4> TomTom Notifications / svc_lns_notifications@tomtom.com / www.tomtom.com