get_notification_data

The get_notification_data method is used to get detailed information about specified notifications.

Endpoint

Copied!
svc=resource/get_notification_data&params={
  "itemId": <long>,
  "col": [
    <long>
  ]
}

Parameters

Name Description
itemId Resource ID.
col The array of notification IDs.

Response

If the request is completed successfully, a response of the following format is returned:

Copied!
[
  {
    "id": <long>,              /* notification ID */
    "n": "<text>",              /* name */
    "txt": "<text>",            /* notification text */
    "ta": <uint>,               /* activation time (Unix format) */
    "td": <uint>,               /* deactivation time (Unix format) */
    "ma": <uint>,               /* maximum number of alarms (0 — unlimited) */
    "mmtd": <uint>,             /* maximum time interval between messages, s */
    "cdt": <uint>,              /* timeout of alarm, sec */
    "mast": <uint>,             /* minimum duration of the alarm state, s */
    "mpst": <uint>,             /* minimum duration of previous state, s */
    "cp": <uint>,               /* period of control relative to current time, s */
    "fl": <uint>,               /* notification flags (see below) */
    "tz": <uint>,               /* time zone */
    "la": "<text>",             /* user language (two-letter code) */
    "ac": <uint>,               /* alarms count */
    "d": "<text>",              /* notification description */

    "sch": {
      			    /* time limitation */
      "f1": <uint>,             /* beginning of interval 1 (minutes from midnight) */
      "f2": <uint>,             /* beginning of interval 2 (minutes from midnight) */
      "t1": <uint>,             /* end of interval 1 (minutes from midnight) */
      "t2": <uint>,             /* end of interval 2 (minutes from midnight) */
      "m": <uint>,              /* mask of days of month [1: 2||0, 31: 2||30] */
      "y": <uint>,              /* mask of months [Jan: 2||0, Dec: 2||11] */
      "w": <uint>,              /* mask of days of week [Mon: 2||0, Sun: 2||6] */
      "fl": <int>               /* schedule flags */
    },

    "ctrl_sch": {
      			    /* schedule of maximum alarms count intervals */
      "f1": <uint>,             /* beginning of interval 1 (minutes from midnight) */
      "f2": <uint>,             /* beginning of interval 2 (minutes from midnight) */
      "t1": <uint>,             /* end of interval 1 (minutes from midnight) */
      "t2": <uint>,             /* end of interval 2 (minutes from midnight) */
      "m": <uint>,              /* mask of days of month [1: 2||0, 31: 2||30] */
      "y": <uint>,              /* mask of months [Jan: 2||0, Dec: 2||11] */
      "w": <uint>,              /* mask of days of week [Mon: 2||0, Sun: 2||6] */
      "fl": <int>               /* schedule flags */
    },

    "un": [
      <long>
    ],                           /* array of IDs of units/unit groups */

    "act": [
      {
        "t": "<text>",           /* action type (see below) */
        "p": {
          "blink": "<text>",     /* mini-map blinking when triggered */
          "color": "<text>",     /* online notification colour */
          "url": "<text>",       /* URL address of notification sound */
          ...
        }
      }
    ],                           /* actions */

    "trg": {
      "t": "<text>",             /* control type (see below) */
      "p": {
        "<text>": "<text>"
        /* parameter name: value */
      }
    },

    "ct": <uint>,                /* creation time */
    "mt": <uint>                 /* last modification time */
  }
]
Parameter Description
id Notification ID.
n Notification name.
txt Notification text.
ta Activation time (Unix format). Corresponds to the Activation time setting.
td Deactivation time (Unix format). Corresponds to the Deactivation time setting.
ma Maximum number of alarms (0 means unlimited). Corresponds to the Max. triggers setting.
mmtd Maximum time interval between messages, in seconds. Corresponds to the Max. time difference between messages setting.
cdt Message analysis timeout, in seconds. Corresponds to the Message analysis timeout setting.
mast Minimum duration of the alarm state, in seconds. Corresponds to the Min. duration of trigger state setting.
mpst Minimum duration of previous state, in seconds. Corresponds to the Ignore trigger state interruptions under setting.
cp Control period relative to the current time, in seconds. Corresponds to the Allowed message delay setting.
fl Notification flags (see below).
tz Time zone.
la User language (two-letter code).
ac Alarms count (number of times the notification has been triggered).
d Notification description.
sch Notification schedule. Contains time intervals (f1, f2, t1, t2 in minutes from midnight), day-of-month mask (m), month mask (y), day-of-week mask (w), and schedule flags (fl).
ctrl_sch Schedule for the Max. triggers counter reset intervals. Uses the same structure as sch.
un Array of unit or unit group IDs that the notification monitors.
act Array of actions. Each action has a type (t) and parameters (p). See Action types.
trg Trigger configuration. Structure depends on the trigger type: single-control type (see Control types) or expression-based type (see Combination of several conditions). The expression-based type is not available in Wialon Local.
ct Creation time (Unix format).
mt Last modification time (Unix format).

Notification flags:

Flag Description
0x0 Notification triggers only on state change from non-alarm to alarm.
0x1 Notification triggers for every message within alarm state.
0x2 Notification is disabled.

For notifications of the Off time control type, the value of the mast parameter specified in seconds must correspond to the value of the min_idle_time parameter specified in minutes. Thus, if you want the notification to be triggered after 10 minutes of off time, specify 10 for min_idle_time and 600 for mast.

If the request fails, an error code is returned.

Action types

The following types of actions are available for notifications:

Notify by email

Copied!
{
	"t":"email",		/* action type */
	"p":{
		"email_to":"<text>",	/* email address */
		"html":"<text>",		/* use HTML tags: 0 — no, 1 — yes */
		"img_attach":"<text>",	/* attach image from notification: 1 — yes, 0 — no */
		"subj":"<text>"		/* text of message */
	}
}

Notify by SMS

Copied!
{
	"t":"sms",		/* action type */
	"p":{
		"phones":"<text>"		/* list of phone numbers (separated by semicolons) */
	}
}

Display online notification in a pop-up window

Copied!
{
	"t":"message",		/* action type */
	"p":{
		"color":"<text>",		/* notification colour */
		"name":"<text>",		/* notification name */
		"url":"<text>"		/* URL address of the notification sound */
	}
}

Send mobile notification

Copied!
{
	"t":"mobile_apps",		/* action type */
	"p":{
		"apps":"{\"<text>\":[	/* mobile app name */
				<uint>	/* user ID */
		]}"
	}
}

Send a request

Copied!
{
	"t":"push_messages",	/* action type */
	"p":{
		"url":"<text>",		/* server name (port may be defined), start it with "http(s)" */
		"get":<bool>		/* request type: 1 — GET, 0 — POST */		
	}
}

Send notification to Telegram

Copied!
{
	"t":"messenger_messages",	/* action type */
	"p":{
		"chat_id":"<text>",		/* channel ID in Telegram */
		"token":"<text>"		/* user token in Telegram */		
	}
}

Send notification to WhatsApp

Copied!
{
	"t":"whatsapp",	/* action type */
	"p":{
          "sender": "<text>",      /* sender's phone number */
          "recipients": "<text>",  /* phone numbers of  recipients */
          "templateSid": "<text>", /* Twilio Content SID of the approved WhatsApp template */
          "templateTags": "<text>" /* JSON object mapping template variable index (as string keys "1", "2", ...) to a Wialon notification tag placeholder name (without % signs)  */
        }
}

Register event for unit

Copied!
{
	"t":"event",		/* action type */
	"p":{
		"flags":"<text>"		/* register as: 0 — event, 1 — violation */
	}
}

Send a command

Copied!
{
	"t":"exec_cmd",		/* action type */
	"p":{
		"cmd_type":"<text>",	/* command type */
		"link":"<text>",		/* link type */
		"name":"<text>",		/* command name */
		"param":"<text>"		/* parameters */
	}
}

You can find the list of available types of methods here.

Change access to units

Copied!
{
	"t":"user_access",	/* action type */
	"p":{
		"acl_bits":"<text>",	/* 1 — set bit, 0 — remove bit */
		"acl_mask":"<text>",	/* mask of bits which must be changed */
		"units":"<text>",		/* list of unit IDs (separated by commas) */
		"users":"<text>"		/* list of user IDs (separated by commas) */
	}
}

Set counter value

Copied!
{
	"t":"counter",		/* action type */
	"p":{
		"engine_hours":"<text>",	/* engine hours counter value */
		"flags":"<text>",		/* counter flags (see below) */
		"mileage":"<text>",	/* mileage counter value */
		"traffic":"<text>"	/* GPRS traffic counter value */
	}
}

Counter flags:

Flag Description
1 Set mileage counter value.
2 Set engine hours counter value.
4 Set GPRS traffic counter value.

Store counter value as a parameter

Copied!
{
	"t":"store_counter",		/* action type */
	"p":{
		"engine_hours":"<text>",		/* name of parameter for engine hours counter */
		"flags":"<text>",			/* flags (see below) */
		"mileage":"<text>"		/* name of parameter for mileage counter */
	}
}

Flags:

Flag Description
1 Store mileage counter value as a parameter.
2 Store engine hours counter value as a parameter.

Register unit status

Copied!
{
	"t":"status",		/* action type */
	"p":{
		"ui_text":"<text>"	/* status */
	}
}

Add or remove units from groups

Copied!
{
	"t":"group_manipulation",	/* action type */
	"p":{
		"add_to":"<text>",		/* add to specified groups */
		"remove_from":"<text>"		/* remove from specified groups */
	}
}

Send a report by email

Copied!
{
	"t":"email_report",	/* action type */
	"p":{
		"email_to":"<text>",		/* email address */
		"file_type":"<text>",		/* file format (see below) */
		"flags":"<text>",			/* interval flags */
		"params":"<text>",		/* report configuration (XML) */
		"report_guid":"<text>",		/* resource ID */
		"report_id":"<text>",		/* template ID */
		"report_object_guid":"<text>",	/* ID of item for report */
		"report_object_id":"<text>",	/* ID of subitem (0 — if report executed for item) */
		"time_from":"<text>",		/* the beginning of the time interval */
		"time_to":"<text>"		/* the end of the time interval */
	}
}

Interval flags are described here.

File formats:

  • 1 — HTML
  • 2 — PDF
  • 4 — XLS
  • 8 — XLSX
  • 16 — XML
  • 32 — CSV

Create a ride

Copied!
{
	"t":"route_control",	/* action type */
	"p":{
		"description":"<text>",	/* description */
		"expiration":"<text>",	/* expiration date */
		"flags":"<text>",		/* ride flags */
		"name":"<text>",		/* name */
		"route":"<text>",		/* route ID */
		"schedule":"<text>"	/* schedule ID */
	}
}

Ride flags are described here.

Separate driver

Copied!
{
	"t":"drivers_reset",	/* action type */
	"p":{}
}

Separate trailer

Copied!
{
	"t":"trailers_reset",	/* action type */
	"p":{}
}

Create task

Copied!
{
	"t": "create_task",	/* action type */
	"p": {
        "task_priority": "<int>", /* task priority */
        "task_assignee": "<int>" /* ID of the user to whom the task is assigned */
	}
}

Control types

The following control types are available for notifications:

Geofence

Copied!
"trg":{
	"t":"geozone",		/* control type */
	"p":{
		"sensor_type":"<text>",		/* sensor type */
		"sensor_name_mask":"<text>",	/* sensor name mask */
		"lower_bound":<uint>,		/* sensor value from */
		"upper_bound":<uint>,		/* sensor value to */
		"prev_msg_diff":<uint>, 	/* this flag allows forming boundaries for the current value according to the previous value(prev) in the following way: [prev+lower_bound ; prev+upper_bound]; so boundaries for the current value are always relative to the previous value; 0 — disable the option, 1 — enable the option */
		"merge":<uint>,			/* similar sensors: 0 — calculate separately, 1 — sum up values */
		"reversed":<uint>,		/* trigger: 0 — in the specified range, 1 — out of the specified range */
		"geozone_ids":"<text>",		/* list of geofence references separated by commas in format propID:createTime (for geofences from the same resource as the notification) or itemId_propId:createTime (for geofences from a different resource). For example, to reference a geofence with ID 15 created on 2024-01-15 at 10:30:00 UTC (timestamp: `1705315800`), specify "15:1705315800" */
		"type":<uint>,			/* control type: 0 — control entries to a geofence, 1 — control exits from a geofence */
		"min_speed":<uint>,		/* minimum speed, km/h */
		"max_speed":<uint>,		/* maximum speed, km/h */
		"include_lbs":<uint>,		/* process LBS messages: 1 — yes, 0 — no */
		"lo":"<text>"			/* logic operator (optional): "AND", "OR" */
	}
}

You can use the resource/get_zone_data method to retrieve geofence properties.

Address

Copied!
"trg":{
	"t":"address",		/* control type */
	"p":{
		"sensor_type":"<text>",		/* sensor type */
		"sensor_name_mask":"<text>",	/* sensor name mask */
		"lower_bound":<uint>,		/* sensor value from */
		"upper_bound":<uint>,		/* sensor value to */
		"prev_msg_diff":<uint>, 	/* this flag allows forming boundaries for the current value according to the previous value(prev) in the following way: [prev+lower_bound ; prev+upper_bound]; so boundaries for the current value are always relative to the previous value; 0 — disable the option, 1 — enable the option */
		"merge":<uint>,			/* similar sensors: 0 — calculate separately, 1 — sum up values */
		"reversed":<uint>,		/* trigger: 0 — in the specified range, 1 — out of the specified range */
		"radius":<uint>,		/* trigger radius */ 
		"type":<uint>,			/* control type: 0 — control in the address radius, 1 — control out of the address radius */
		"min_speed":<uint>,		/* minimum speed, km/h */
		"max_speed":<uint>,		/* maximum speed, km/h */
		"country":"<text>",		/* country */
		"region":"<text>",		/* region */
		"city":"<text>",			/* city */
		"street":"<text>",		/* street */
		"house":"<text>",			/* house */
		"include_lbs":<uint>		/* process LBS messages: 1 — yes, 0 — no */
	}
}

Speed

Copied!
"trg":{
	"t":"speed",		/* control type */
	"p":{
		"lower_bound":"<text>",	/* sensor value from */
		"max_speed":"<text>",	/* maximum speed, km/h */
		"merge":"<text>",		/* similar sensors: 0 — calculate separately, 1 — sum up values */
		"min_speed":"<text>",	/* minimum speed, km/h */
		"prev_msg_diff":"<text>", /* this flag allows forming boundaries for the current value according to the previous value(prev) in the following way: [prev+lower_bound ; prev+upper_bound]; so boundaries for the current value are always relative to the previous value; 0 — disable the option, 1 — enable the option */
		"reversed":"<text>",	/* trigger: 0 — in the specified range, 1 — out of the specified range */
		"sensor_name_mask":"<text>",	/* sensor name mask */
		"sensor_type":"<text>",	/* sensor type */
		"upper_bound":"<text>"	/* sensor value to */
		"driver":"<text>"	/* this flag allows taking into account driver assignments: 1 — the notification will be triggered when no driver is assigned, 2 — it will be  triggered when there is an assigned driver, 0 — this flag will be ignored */
	}
}

Alarm (SOS)

Copied!
"trg":{
	"t":"alarm",		/* control type */
	"p":{}
}

Digital input

Copied!
"trg":{
	"t":"digital_input",	/* control type */
	"p":{
		"input_index":"<text>",	/* digital input (1-32) */
		"type":"<text>"  		/* control type: 0 — check for activation, 1 — check for deactivation */
	}
}

Parameter in a message

Copied!
"trg":{
	"t":"msg_param",	/* control type */
	"p":{
		"kind":"<text>",		/* parameter control type (see below) */
		"lower_bound":"<text>",	/* parameter value from */
		"param":"<text>",		/* parameter name */
		"text_mask":"<text>",	/* text mask */
		"type":"<text>",		/* trigger: 0 — in the specified range, 1 — out of the specified range */
		"upper_bound":"<text>"	/* parameter value to */
	}
}

Parameter control types:

Type Description
0 Value range.
1 Text mask.
2 Parameter availability.
3 Parameter lack.

Sensor value

Copied!
"trg":{
	"t":"sensor_value",		/* control type */
	"p":{
		"lower_bound":"<text>",		/* sensor value from */
		"merge":"<text>",			/* similar sensors: 0 — calculate separately, 1 — sum up values */
		"prev_msg_diff":"<text>",         /* this flag allows forming boundaries for the current value according to the previous value(prev) in the following way: [prev+lower_bound ; prev+upper_bound]; so boundaries for the current value are always relative to the previous value; 0 — disable the option, 1 — enable the option */
		"sensor_name_mask":"<text>",	/* sensor name mask */
		"sensor_type":"<text>",		/* sensor type */
		"type":"<text>",			/* trigger: 0 — in the specified range, 1 — out of the specified range */
		"upper_bound":"<text>"		/* sensor value to */
	}
}

Connection loss

Copied!
"trg":{
	"t":"outage",		/* control type */
	"p":{
		"time":"<text>",		/* time interval, s */
		"type":"<text>",		/* control type: 0 — coordinates loss, 1 — connection loss */
		"include_lbs":<uint>,	/* process LBS messages: 1 — yes, 0 — no  */
		"check_restore":<uint>,	/* notify when: 0 — connection lost, 1 — connection lost and restored, 2 — connection restored */
		"geozones_type":"<text>", /* control type: 0 — out of geofence, 1 — in geofence */ 
		"geozones_list":"<text>"  /* list of geofence references separated by commas in format propID:createTime (for geofences from the same resource as the notification) or itemId_propId:createTime (for geofences from a different resource). For example, to reference a geofence with ID 15 created on 2024-01-15 at 10:30:00 UTC (timestamp: `1705315800`), specify "15:1705315800" */
	}
}

Off time

Copied!
"trg":{
	"t":"speed",		/* control type */
	"p":{
		"lower_bound":"<text>",		/* sensor value from */
		"max_speed":"<text>",		/* maximum speed, km/h */
		"merge":"<text>",			/* similar sensors: 0 — calculate separately, 1 — sum up values */
		"min_idle_time":"<text>",		/* minimum idle time, min */
		"min_speed":"<text>",		/* minimum speed, km/h */
		"prev_msg_diff":"<text>",         /* this flag allows forming boundaries for the current value according to the previous value(prev) in the following way: [prev+lower_bound ; prev+upper_bound]; so boundaries for the current value are always relative to the previous value; 0 — disable the option, 1 — enable the option */
		"reversed":"<text>",		/* trigger: 0 — in the specified range, 1 — out of the specified range */
		"sensor_name_mask":"<text>",	/* sensor name mask */
		"sensor_type":"<text>",		/* sensor type */
		"upper_bound":"<text>",		/* sensor value to */
		"geozones_type":"<text>", 	/* control type: 0 — out of geofence, 1 — in geofence */ 
		"geozones_list":"<text>"  	/* list of geofence references separated by commas in format propID:createTime (for geofences from the same resource as the notification) or itemId_propId:createTime (for geofences from a different resource). For example, to reference a geofence with ID 15 created on 2024-01-15 at 10:30:00 UTC (timestamp: `1705315800`), specify "15:1705315800" */
	}
}

The value of the min_idle_time parameter specified in minutes must correspond to the value of the mast parameter specified in seconds. Thus, if you want the notification to be triggered after 10 minutes of off time, specify 10 for min_idle_time and 600 for mast.

SMS

Copied!
"trg":{
	"t":"sms",		/* control type */
	"p":{
		"mask":"<text>"		/* SMS text mask */
	}
}

Interposition of units

Copied!
"trg":{
	"t":"interposition",		/* control type */
	"p":{
		"sensor_name_mask":"<text>",	/* sensor name mask */
		"sensor_type":"<text>",		/* sensor type */
		"lower_bound":"<text>",		/* sensor value from */
		"upper_bound":"<text>"		/* sensor value to */
		"merge":"<text>",			/* similar sensors: 0 — calculate separately, 1 — sum up values */
		"max_speed":"<text>",		/* maximum speed, km/h */
		"min_speed":"<text>",		/* minimum speed, km/h */
		"reversed":"<text>",		/* trigger: 0 — in the specified range, 1 — out of the specified range */
		"prev_msg_diff":"<text>",         /* this flag allows forming boundaries for the current value according to the previous value(prev) in the following way: [prev+lower_bound ; prev+upper_bound]; so boundaries for the current value are always relative to the previous value; 0 — disable the option, 1 — enable the option */
		"radius":"<text>",		/* radius, m */
		"type":"<text>",			/* control type: 0 — control approaching to units, 1 — control moving away from units */
		"unit_guids":"<text>",		/* the list of control unit IDs (separated by commas) */
		"include_lbs":<uint>,		/* process LBS messages: 1 — yes, 0 — no */
		"lo":"<text>"			/* logic operator (optional): "AND", "OR" */
	}
}

Excess of messages

Copied!
"trg":{
	"t":"msgs_counter",		/* control type */
	"p":{
		"flags":"<text>",			/* message type: 1 — data messages, 2 — SMS messages */
		"msgs_limit":"<text>",		/* limit of messages */
		"time_offset":"<text>"		/* reset counter each (limit 24h), s */
	}
}

Route progress

Copied!
"trg":{
	"t":"route_control",		/* control type */
	"p":{
		"mask":"<text>",			/* route name mask */
		"round_mask":"<text>",		/* ride name mask */
		"schedule_mask":"<text>",		/* schedule name mask */
		"types":"<text>"			/* route control types (separated by commas) */
	}
}

Route control types:

Type Description
1 Ride started.
2 Ride finished.
4 Ride aborted.
8 Arrival at check point.
16 Check point skipped.
32 Departure from check point.
64 Delay.
128 Outrunning.
256 Return to schedule.

Driver

Copied!
"trg":{
	"t":"driver",		/* control type */
	"p":{
		"driver_code_mask":"<text>",	/* driver code mask */
		"flags":"<text>"			/* control type: 1 — driver assignment, 2 — driver separation */
	}
}

Trailer

Copied!
"trg": {
	"t": "trailer",		/* control type */
	"p": {
		"driver_code_mask": "<text>",	/* trailer code mask */
		"flags": "<text>"			/* control type: 1 — trailer assignment, 2 — trailer separation */
	}
}

Maintenance

Copied!
"trg":{
	"t":"service_intervals",	/* control type */
	"p":{
		"days":"<text>",			/* days interval */
		"engine_hours":"<text>",		/* engine hours interval, h */
		"flags":"<text>",			/* maintenance control flags (see below) */
		"mask":"<text>",			/* wildcard based mask */
		"mileage":"<text>",		/* mileage interval, km */
		"val":"<text>"			/* notify when: 1 — service term approaches, -1 — service term is expired */
	}
}

Maintenance control flags:

Flag Description
0 Control all service intervals.
1 Mileage interval.
2 Engine hours interval.
4 Days interval.

Fuel filling or battery charge

Copied!
"trg":{
	"t":"fuel_filling",	/* control type */
	"p":{
		"sensor_name_mask":"<text>",			/* sensor name mask */
		"geozones_type":<uint>,		/* geofence control type: 0 — disabled or outside geofence, 1 — inside geofence */
		"geozones_list":"<text>",			/* list of geofence references separated by commas in format propID:createTime (for geofences from the same resource as the notification) or itemId_propId:createTime (for geofences from a different resource). For example, to reference a geofence with ID 15 created on 2024-01-15 at 10:30:00 UTC (timestamp: `1705315800`), specify "15:1705315800" */
		"realtime_only":<uint>,			/* ignore the recalculation of historical data: 0 — disable, 1 — enable */
	}
}

Fuel drain

Copied!
"trg":{
	"t":"fuel_theft",	/* control type */
	"p":{
		"sensor_name_mask":"<text>",			/* sensor name mask */
		"geozones_type":<uint>,		/* geofence control type: 0 — disabled or outside geofence, 1 — inside geofence */
		"geozones_list":"<text>",		 /* list of geofence references separated by commas in format propID:createTime (for geofences from the same resource as the notification) or itemId_propId:createTime (for geofences from a different resource). For example, to reference a geofence with ID 15 created on 2024-01-15 at 10:30:00 UTC (timestamp: `1705315800`), specify "15:1705315800" */
		"realtime_only":<uint>,			/* ignore the recalculation of historical data: 0 — disable, 1 — enable */
	}
}

Health check status

Copied!
"trg": {
        "t": "health_check",  /* Control type */
        "p": {
            "healthy": <uint>,  /* Shows if the device is healthy: 0 — no, 1 — yes */
            "unhealthy": <uint>,   /* Shows if the device is unhealthy: 0 — no, 1 — yes */
            "needAttention": <uint>,  /* Shows if the device is needs attention: 0 — no, 1 — yes */
            "triggerForEachIncident": <uint>  /* Trigger for each incident: 0 — disabled, 1 — enabled */
        }
    }

Combination of several conditions

This control type allows combining up to three notification conditions in a single expression using logical operators (AND/OR).

The expression-based control type is not available in Wialon Local.

Copied!
"trg": {
    "t": "expression",
    "p": {},
    "expression": "<text>",      /* Text string defining the logical expression combining several conditions. Uses condition names connected with "AND" or "OR" operators. */
    "conditions": {              /* Parameters for each condition in the expression. Keys are condition names from the expression, values are objects with condition-specific parameters. */
        "<condition_name>": {
            /* Condition-specific parameters */
        }
    }
}

Supported condition types

There are combinable and non-combinable condition types. Combinable ones can be used with AND/OR operators (up to 3 conditions), whereas non-combinable ones must be the only condition in the expression.

Combinable conditions

Condition type Description
speed Speed threshold violation.
idling Engine idling detection.
speed_gis Speed limit violation according to GIS.
driver_unassigned Driver separation from the unit.
address Address-based trigger.
geozone_inside Unit entering geofence.
geozone_outside Unit leaving geofence.
interposition Unit distance from other units.
sensor_range Sensor value within or outside the specified range.
sensor_change Sensor value change.
alarm Alarm button activation.
msg_param Parameter in a message.
digital_input Digital input state.
eco_driving Eco driving violation.

Non-combinable conditions

Condition type Description
tag Passenger assignment to the unit.
msgs_counter Message limit reached.
trailer Trailer assignment to the unit.
driver Driver assignment to the unit.
sms SMS reception.

Expression examples:

  • "geozone_inside OR geozone_outside"
  • "speed AND driver_unassigned"
  • "address OR sensor_range"

If the same condition type is used multiple times, add an underscore and number suffix:

  • "geozone_inside_1 AND geozone_inside_2 AND speed"

Condition parameters

Each condition in the conditions object has specific parameters depending on its type.

Speed

Copied!
{
    "speed": {
        "min_speed": <uint>,   /* minimum speed, km/h */
        "max_speed": <uint>,   /* maximum speed, km/h */
        "include_lbs": <uint>  /* process LBS messages: 1 — yes, 0 — no */
    }
}

Idling (off time)

Copied!
{
    "idling": {
        "min_speed": <uint>,        /* minimum speed, km/h */
        "max_speed": <uint>,        /* maximum speed, km/h */
        "min_idle_time": <uint>     /* minimum idle time, min */
    }
}

Speed road limit

Copied!
{
    "speeding_gis": {
        "speeding_tolerance": <any>,    /* speeding tolerance */
        "include_lbs": <uint>           /* process LBS messages: 1 — yes, 0 — no */
    }
}

Sensor range

Copied!
{
    "sensor_range": {
        "sensor_type": "<text>",        /* sensor type */
        "sensor_name_mask": "<text>",   /* sensor name mask */
        "merge": <uint>,                /* similar sensors: 0 — calculate separately, 1 — sum up values */
        "lower_bound": <double>,        /* sensor value from */
        "upper_bound": <double>,        /* sensor value to */
        "reversed": <uint>              /* trigger: 0 — in the specified range, 1 — out of the specified range */
    }
}

Sensor value

Copied!
{
    "sensor_change": {
        "sensor_type": "<text>",        /* sensor type */
        "sensor_name_mask": "<text>",   /* sensor name mask */
        "lower_bound": <double>,        /* sensor value change from (relative to previous message) */
        "upper_bound": <double>         /* sensor value change to (relative to previous message) */
    }
}

Driver unassigned

Copied!
{
    "driver_unassigned": {
        "driver": <uint>    /* this flag allows taking into account driver assignments: 1 — the condition is met when no driver is assigned, 2 — the condition is met when there is an assigned driver, 0 — this flag is ignored */
    }
}

Alarm

Copied!
{
    "alarm": {}
}

Parameter in a message

Copied!
{
    "msg_param": {
        "kind": <uint>,            /* parameter control type: 0 — value range, 1 — text mask, 2 — parameter availability, 3 — parameter lack */
        "lower_bound": <double>,   /* parameter value from */
        "param": "<text>",         /* parameter name */
        "text_mask": "<text>",     /* text mask */
        "type": <uint>,            /* trigger: 0 — in the specified range, 1 — out of the specified range */
        "upper_bound": <double>    /* parameter value to */
    }
}

Digital input

Copied!
{
    "digital_input": {
        "input_index": <uint>,   /* digital input (1-32) */
        "type": <uint>           /* control type: 0 — check for activation, 1 — check for deactivation */
    }
}

Unit inside geofence

Copied!
{
    "geozone_inside": {
        "geozone_ids": "<text>",   /* list of geofence references separated by commas in format propID:createTime (for geofences from the same resource as the notification) or itemId_propId:createTime (for geofences from a different resource) */
        "lo": "<text>",            /* logic operator (optional): "AND", "OR" */
        "include_lbs": <uint>      /* process LBS messages: 1 — yes, 0 — no */
    }
}

Unit outside geofence

Copied!
{
    "geozone_outside": {
        "geozone_ids": "<text>",   /* list of geofence references separated by commas in format propID:createTime (for geofences from the same resource as the notification) or itemId_propId:createTime (for geofences from a different resource) */
        "lo": "<text>",            /* logic operator (optional): "AND", "OR" */
        "include_lbs": <uint>      /* process LBS messages: 1 — yes, 0 — no */
    }
}

Address

Copied!
{
    "address": {
        "city": "<text>",      /* city */
        "country": "<text>",   /* country */
        "house": "<text>",     /* house */
        "radius": <uint>,      /* trigger radius */
        "region": "<text>",    /* region */
        "street": "<text>",    /* street */
        "type": <uint>,        /* control type: 0 — in the address radius, 1 — out of the address radius */
        "include_lbs": <uint>  /* process LBS messages: 1 — yes, 0 — no */
    }
}

Unit interposition

Copied!
{
    "interposition": {
        "lo": "<text>",        /* logic operator (optional): "AND", "OR" */
        "radius": <uint>,      /* radius, m */
        "type": <uint>,        /* control type: 0 — control approaching to units, 1 — control moving away from units */
        "unit_guids": "<text>", /* the list of control unit IDs (separated by commas) */
        "include_lbs": <uint>  /* process LBS messages: 1 — yes, 0 — no */
    }
}

Connection loss

Copied!
{
    "outage": {
        "check_restore": <uint>,   /* notify when: 0 — connection lost, 1 — connection lost and restored, 2 — connection restored */
        "time": <uint>,            /* time interval, s */
        "type": <uint>,            /* control type: 0 — coordinates loss, 1 — connection loss */
        "include_lbs": <uint>      /* process LBS messages: 1 — yes, 0 — no */
    }
}

SMS

Copied!
{
    "sms": {
        "mask": "<text>"   /* SMS text mask */
    }
}

Message limit

Copied!
{
    "msgs_counter": {
        "flags": <uint>,      /* message type: 1 — data messages, 2 — SMS messages */
        "msgs_limit": <uint>, /* limit of messages */
        "time_offset": <uint> /* reset counter each (limit 24h), s */
    }
}

Passenger activity

Copied!
{
    "tag": {
        "tag_code_mask": "<text>",   /* tag code mask */
        "type": <uint>              /* control type: 1 — check-in, 2 — check-out */
    }
}

Passenger alarm

Copied!
{
    "tag_alarm": {
        "time": <uint>   /* alarm timeout, s */
    }
}

Driver

Copied!
{
    "driver": {
        "code_mask": "<text>",   /* driver code mask */
        "flags": <uint>          /* control type: 1 — driver assignment, 2 — driver separation */
    }
}

Trailer

Copied!
{
    "trailer": {
        "code_mask": "<text>",   /* trailer code mask */
        "flags": <uint>          /* control type: 1 — trailer assignment, 2 — trailer separation */
    }
}

Route activity

Copied!
{
    "route_control": {
        "mask": "<text>",          /* route name mask */
        "round_mask": "<text>",    /* ride name mask */
        "schedule_mask": "<text>", /* schedule name mask */
        "types": "<text>"          /* route control types (separated by commas): 1 — ride started, 2 — ride finished, 4 — ride aborted, 8 — arrival at check point, 16 — check point skipped, 32 — departure from check point, 64 — delay, 128 — outrunning, 256 — return to schedule */
    }
}

Fuel filling

Copied!
{
    "fuel_filling": {
        "realtime_only": <uint>,       /* ignore the recalculation of historical data: 0 — disable, 1 — enable */
        "sensor_name_mask": "<text>"   /* sensor name mask */
    }
}

Fuel drain

Copied!
{
    "fuel_theft": {
        "realtime_only": <uint>,       /* ignore the recalculation of historical data: 0 — disable, 1 — enable */
        "sensor_name_mask": "<text>"   /* sensor name mask */
    }
}

Battery charge

Copied!
{
    "battery_charge": {
        "realtime_only": <uint>,       /* ignore the recalculation of historical data: 0 — disable, 1 — enable */
        "sensor_name_mask": "<text>"   /* sensor name mask */
    }
}

Eco driving

Copied!
{
    "eco_driving": {
        "criterions": [              /* array of eco driving criterion filters */
            {
                "type": "<text>",    /* criterion type: speeding, acceleration, braking, turn, idling, harsh (reckless driving), sensor (custom) */
                "mask": "<text>"     /* criterion name mask */
            }
        ]
    }
}

The notification is triggered when an eco driving violation event ends. To use this condition, eco driving criteria must be configured on the unit using unit/update_drive_rank_settings.

When combining the eco_driving condition with other conditions, eco_driving must be the first condition in the expression. The system checks other conditions against the message at the violation start time, but the notification triggers at the violation end time.

The eco_driving condition can be combined with fuel_filling, fuel_theft, and battery_charge only using the OR operator.

Maintenance

Copied!
{
    "service_intervals": {
        "days": <long>,          /* days interval */
        "engine_hours": <long>,  /* engine hours interval, h */
        "flags": <uint>,         /* maintenance control flags : 0 — control all service intervals, 1 — mileage interval, 2 — engine hours interval, 4 — days interval */
        "mask": "<text>",        /* wildcard-based mask for service interval name */
        "mileage": <long>,       /* mileage interval, km */
        "val": <long>            /* notify when: 1 — service term approaches, -1 — service term is expired */
    }
}

Health status

Copied!
{
    "health_check": {
        "healthy": <any>,                /* trigger on "healthy" status: "0"no, "1" — yes */
		"needAttention": <any>,          /* trigger on "needs attention" status: "0"no, "1" — yes */
        "triggerForEachIncident": <any>,  /* trigger for each incident in "needs attention" state: "0" — disabled, "1" — enabled */
		"unhealthy": <any>              /* trigger on "unhealthy" status: "0"no, "1" — yes */
    }
}

Error codes

Code Description
4 Wrong input parameters.
7 The user doesn’t have the required access right to the resource (ADF_ACL_AVL_RES_VIEW_NF).

If you find a mistake in the text, please select it and press Ctrl+Enter.

Report a mistake

Your message was sent. Thank you!

An error occurred while submitting the form