Notifications configuration
This API is used to create, retrieve, update, and delete notification configurations in the PILOT system.
This API is not intended for sending notifications. Instead, it defines the conditions under which notifications will be triggered in the future.
Supported HTTP Methods
POST — create a new notification configuration
GET— retrieve a notification configuration by ID
PUT — update an existing notification configuration
DELETE— remove one or more notification configurations
Base URL: https://<address>/api/ptm/notification.php
<address> — your server or system domain name
POST
Creates a new notification configuration.
The request body is required.
Request URL
https://<address>/api/ptm/notification.php
|
Request body example (JSON)
{
"id": 0,
"agent_id": 123,
"type": "speed",
"geozones": [
{
"name": "Warehouse",
"zonetype": 1,
"points": [
[55.7558, 37.6173],
[55.7560, 37.6180],
[55.7565, 37.6170]
]
}
],
"name": "Speeding in warehouse zone",
"email": true,
"emails_list": [
"dispatcher@example.com",
"manager@example.com"
],
"sms": true,
"phones_list": [
"+79001234567",
"+79007654321"
],
"message_text": "Alert! Speed limit exceeded in warehouse zone.",
"webhook": true,
"webhook_url": "https://yourdomain.com/webhook-handler",
"ts": 1680000000,
"te": 1710000000,
"timezone": 3,
"zone_rule": "in",
"speed_rule": ">",
"speed_value": 80,
"speed_time": 15,
"speed_time_units": "ss",
"ignition_rule": "on",
"geozones_rule": "in",
"break_duration": 0,
"break_time_units": "ss",
"tag_name": "truck",
"temperature_rule": ">",
"temperature_value": 30,
"temperature_time": 0,
"disconnect_time": 0,
"disconnect_time_units": "ss",
"odometer_rule": ">",
"odometer_value": 100000,
"odometer_period": "abs"
}
|
Response example
{
"success": true,
"msg": "Notification successfully created",
"method": "POST",
"notification": {
"id": 123,
"agent_id": 123,
"type": "speed",
"geozones": [
{
"name": "Warehouse",
"zonetype": 1,
"points": [
[55.7558, 37.6173],
[55.7560, 37.6180],
[55.7565, 37.6170]
]
}
],
"name": "Speeding in warehouse zone",
"email": true,
"emails_list": [
"dispatcher@example.com",
"manager@example.com"
],
"sms": true,
"phones_list": [
"+79001234567",
"+79007654321"
],
"message_text": "Alert! Speed limit exceeded in warehouse zone.",
"webhook": true,
"webhook_url": "https://yourdomain.com/webhook-handler",
"ts": 1680000000,
"te": 1710000000,
"timezone": 3,
"zone_rule": "in",
"speed_rule": ">",
"speed_value": 80,
"speed_time": 15,
"speed_time_units": "ss",
"ignition_rule": "on",
"geozones_rule": "in",
"break_duration": 0,
"break_time_units": "ss",
"tag_name": "truck",
"temperature_rule": ">",
"temperature_value": 30,
"temperature_time": 0,
"disconnect_time": 0,
"disconnect_time_units": "ss",
"odometer_rule": ">",
"odometer_value": 100000,
"odometer_period": "abs"
}
}
|
GET
Fetches a notification configuration by its unique ID.
Required query parameter^
-
id — ID of the notification
Request example
https://<address>/api/ptm/notification.php?id=123
|
Response example
{
"success": true,
"msg": "Notification retrieved",
"method": "GET",
"notification": {
"id": 123,
"agent_id": 123,
"type": "speed",
"geozones": [
{
"name": "Warehouse",
"zonetype": 1,
"points": [
[55.7558, 37.6173],
[55.7560, 37.6180],
[55.7565, 37.6170]
]
}
],
"name": "Speeding in warehouse zone",
"email": true,
"emails_list": [
"dispatcher@example.com",
"manager@example.com"
],
"sms": true,
"phones_list": [
"+79001234567",
"+79007654321"
],
"message_text": "Alert! Speed limit exceeded in warehouse zone.",
"webhook": true,
"webhook_url": "https://yourdomain.com/webhook-handler",
"ts": 1680000000,
"te": 1710000000,
"timezone": 3,
"zone_rule": "in",
"speed_rule": ">",
"speed_value": 80,
"speed_time": 15,
"speed_time_units": "ss",
"ignition_rule": "on",
"geozones_rule": "in",
"break_duration": 0,
"break_time_units": "ss",
"tag_name": "truck",
"temperature_rule": ">",
"temperature_value": 30,
"temperature_time": 0,
"disconnect_time": 0,
"disconnect_time_units": "ss",
"odometer_rule": ">",
"odometer_value": 100000,
"odometer_period": "abs"
}
}
|
PUT
Updates an existing notification configuration.
Use the same format as in POST, but with the actual id of the notification to be updated.
Request URL
https://<address>/api/ptm/notification.php
|
Request body example
{
"id": 123,
"agent_id": 123,
"type": "speed",
"geozones": [
{
"name": "Warehouse",
"zonetype": 1,
"points": [
[55.7558, 37.6173],
[55.7560, 37.6180],
[55.7565, 37.6170]
]
}
],
"name": "Updated speed alert",
"email": true,
"emails_list": ["alerts@example.com"],
"sms": false,
"phones_list": [],
"message_text": "Updated speed alert message",
"webhook": false,
"webhook_url": "",
"ts": 1680000000,
"te": 1720000000,
"timezone": 3,
"zone_rule": "in",
"speed_rule": ">",
"speed_value": 90,
"speed_time": 10,
"speed_time_units": "ss",
"ignition_rule": "off",
"geozones_rule": "in",
"break_duration": 0,
"break_time_units": "ss",
"tag_name": "van",
"temperature_rule": ">",
"temperature_value": 35,
"temperature_time": 0,
"disconnect_time": 0,
"disconnect_time_units": "ss",
"odometer_rule": ">",
"odometer_value": 120000,
"odometer_period": "abs"
}
|
Response example
{
"success": true,
"msg": "Notification successfully updated",
"method": "PUT",
"notification": {
"id": 123,
"agent_id": 123,
"type": "speed",
"geozones": [
{
"name": "Warehouse",
"zonetype": 1,
"points": [
[55.7558, 37.6173],
[55.7560, 37.6180],
[55.7565, 37.6170]
]
}
],
"name": "Updated speed alert",
"email": true,
"emails_list": ["alerts@example.com"],
"sms": false,
"phones_list": [],
"message_text": "Updated speed alert message",
"webhook": false,
"webhook_url": "",
"ts": 1680000000,
"te": 1720000000,
"timezone": 3,
"zone_rule": "in",
"speed_rule": ">",
"speed_value": 90,
"speed_time": 10,
"speed_time_units": "ss",
"ignition_rule": "off",
"geozones_rule": "in",
"break_duration": 0,
"break_time_units": "ss",
"tag_name": "van",
"temperature_rule": ">",
"temperature_value": 35,
"temperature_time": 0,
"disconnect_time": 0,
"disconnect_time_units": "ss",
"odometer_rule": ">",
"odometer_value": 120000,
"odometer_period": "abs"
}
}
|
DELETE
Deletes one or more notification configurations.
Query parameters:
-
id (optional) — ID of the specific notification to delete
-
agent_id (optional) — Deletes all notifications for the specified agent
Request examples
Delete a single notification:
https://<address>/api/ptm/notification.php?id=123
|
Delete all notifications for an agent:
https://<address>/api/ptm/notification.php?agent_id=456
|
Response example
{
"count": 1 // Number of deleted notifications
}
|
Notification configuration fields description
Field
|
Description
|
id
|
Notification ID
|
agent_id
|
Agent ID (device or vehicle identifier)
|
type
|
Notification type (speed, temperature, ignition, etc.)
|
geozones
|
Array of geofences applicable to this notification
|
name
|
Notification name
|
email
|
Enable email alerts
|
emails_list
|
List of email addresses
|
sms
|
Enable SMS alerts
|
phones_list
|
List of phone numbers
|
message_text
|
Text message of the alert
|
webhook_url
|
Webhook endpoint URL
|
webhook
|
Enable webhook
|
ts, te
|
Start and end time of notification (Unix timestamp)
|
timezone
|
Time zone offset (e.g. +3)
|
zone_rule
|
Zone condition (in, out)
|
speed_rule
|
Speed condition (>, <, =)
|
speed_value
|
Speed threshold
|
speed_time
|
Duration of speed violation
|
speed_time_units
|
Time units: ss (seconds), mm (minutes), hh (hours)
|
ignition_rule
|
Ignition state (on, off)
|
geozones_rule
|
Zone behavior (in, out)
|
break_duration
|
Break duration
|
break_time_units
|
Time units for break: ss, mm, hh
|
temperature_rule
|
Temperature condition (>, <)
|
temperature_value
|
Temperature threshold
|
temperature_time
|
Duration of temperature violation (in units)
|
disconnect_time
|
Device disconnection duration
|
disconnect_time_units
|
Time units for disconnection
|
odometer_rule
|
Odometer condition (>, <, =)
|
odometer_value
|
Odometer value
|
odometer_period
|
Odometer mode (abs, rel)
|
tag_name
|
Object tag (e.g. "truck")
|