Table of Contents

Notifications: detailed information

To get detailed information about specified notifications, use the command resource/get_notification_data:

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

Parameters

Name Description
itemId resource ID
col array of notifications IDs

Response

[
	{
		"id":<long>,	/* notification ID */
		"n":<text>,	/* name */
		"txt":<text>,	/* text of notification */
		"ta":<uint>,	/* activation time (UNIX format) */
		"td":<uint>,	/* deactivation time (UNIX format) */
		"ma":<uint>,	/* maximal alarms count (0 - unlimited) */
		"mmtd":<uint>,	/* maximal time interval between messages (seconds) */
		"cdt":<uint>,	/* timeout of alarm (seconds) */
		"mast":<uint>,	/* minimal duration of alert state (seconds) */
		"mpst":<uint>,	/* minimal duration of previous state (seconds) */
		"cp":<uint>,	/* period of control relative to current time (seconds) */
		"fl":<uint>,	/* notification flags (see below) */
		"tz":<uint>,	/* timezone */
		"la":<text>,	/* user language (two-lettered code) */
		"ac":<uint>,	/* alarms count */
		"sch":{		/* time limitation */
			"f1":<uint>,	/* beginning of interval 1 (minutes from midnight) */
			"f2":<uint>,	/* beginning of interval 2 (minutes from midnight) */
			"t1":<uint>,	/* ending of interval 1 (minutes from midnight) */
			"t2":<uint>,	/* ending of interval 2 (minutes from midnight) */
			"m":<uint>,	/* days of month mask [1: 2^0, 31: 2^30] */
			"y":<uint>,	/* months mask [Jan: 2^0, Dec: 2^11] */
			"w":<uint>	/* days of week mask [Mon: 2^0, Sun: 2^6] */
		},
		"ctrl_sch":{	/* maximal alarms count intervals shedule */
			"f1":<uint>,	/* beginning of interval 1 (minutes from midnight) */
			"f2":<uint>,	/* beginning of interval 2 (minutes from midnight) */
			"t1":<uint>,	/* ending of interval 1 (minutes from midnight) */
			"t2":<uint>,	/* ending of interval 2 (minutes from midnight) */
		 	"m":<uint>,	/* days of month mask [1: 2^0, 31: 2^30] */
		 	"y":<uint>,	/* months mask [Jan: 2^0, Dec: 2^11] */
		 	"w":<uint>	/* days of week mask [Mon: 2^0, Sun: 2^6] */
		},
		"un":[<long>],	/* array units/unit groups ID's */
		"act":[			/* actions */
			{
				"t":<text>,		/* action type (see below) */
				"p":{			/* parameters */
					"blink": <text>,	/* mini-map blinking when triggered */ 
					"color": <text>,	/* online notification color */
					"url": <text>,		/* url of sound */
					...
				},
				...
			}
		],
		"trg":{			/* control */
			"t":<text>,		/* control type (see below) */
			"p":{			/* parameters */
				<text>:<text>,		/* parameter name: value */
				...
			}
		},
		"ct":<uint>,        /* creation time */
		"mt":<uint>         /* last modification time */
	}
]

Notification flags:

Flag Description
0x0 notification triggers for first message
0x1 notification triggers for every message
0x2 notification is disabled

Action types

Notify by e-mail

{
	"t":"email",		/* action type */
	"p":{
		"email_to":<text>,	/* e-mail 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

{
	"t":"sms",		/* action type */
	"p":{
		"phones":<text>		/* list of phone numbers (semicolon-separated) */
	}
}

Display online notification in a popup window

{
	"t":"message",		/* action type */
	"p":{
		"color":<text>,		/* notification color */
		"name":<text>,		/* notification name */
		"url":<text>		/* URL-address to notification sound */
	}
}

Send mobile notification

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

Send a request

{
	"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

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

Register event for unit

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

Execute a command

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

:!: You can see list of available command type here List of available commands

Upload video

{"t":"video_service", /* action type */
"p":{ /* optional */
"channel_mask":int, /* camera mask, by default from unit's properties "video_channel_mask" */
"duration":long, /* video duration, by default - 60 sec */
"base_url":text
 }
}

Change access to units

{
	"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 units IDs (comma-separated) */
		"users":<text>		/* list of users IDs (comma-separated) */
	}
}

Set counter value

{
	"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:

Store counter value as parameter

{
	"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:

Register unit status

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

Modify unit groups

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

Send a report by e-mail

{
	"t":"email_report",	/* action type */
	"p":{
		"email_to":<text>,		/* e-mail 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>,		/* beginning of time interval */
		"time_to":<text>		/* ending of time interval */
	}
}

Interval flags are described in the chapter Reports: Execute report.

File formats:

Create a round

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

Round flags are described in the chapter Round information.

Reset driver

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

Reset trailer

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

Control types

Geofence control

"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 to form boundaries for the current value according to previous value(prev) in such a way: [prev+lower_bound ; prev+upper_bound] -- so boundaries for current value is always relative to previous value; 0 - disable this option, 1 - enable option */
		"merge":<uint>,			/* similar sensors: 0 - calculate separately, 1 - sum up values */
		"reversed":<uint>,		/* trigger: 0 - in specified range, 1 - out of specified range */
		"geozone_ids":<text>,		/* list of geofences IDs (comma-separated) */
		"type":<uint>,			/* check type: 0 - control entries to a geofence, 1 - control exits from a geofence */
		"min_speed":<uint>,		/* minimal speed, km/h */
		"max_speed":<uint>,		/* maximal speed, km/h */
		"include_lbs":<uint>,		/* process LBS messages: 1 - yes, 0 - no  */
		"lo":<text>			/* logic operator (optional): "AND", "OR" */
	}
}

Address control

"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 to form boundaries for the current value according to previous value(prev) in such a way: [prev+lower_bound ; prev+upper_bound] -- so boundaries for current value is always relative to previous value; 0 - disable this option, 1 - enable option */
		"merge":<uint>,			/* similar sensors: 0 - calculate separately, 1 - sum up values */
		"reversed":<uint>,		/* trigger: 0 - in specified range, 1 - out of specified range */
		"radius":<uint>,		/* радиус срабатывания */ 
		"type":<uint>,			/* check type: 0 - control in address radius, 1 - control out of adress radius */
		"min_speed":<uint>,		/* minimal speed, km/h */
		"max_speed":<uint>,		/* maximal 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 control

"trg":{
	"t":"speed",		/* control type */
	"p":{
		"lower_bound":<text>,	/* sensor value from */
		"max_speed":<text>,	/* maximal speed, km/h */
		"merge":<text>,		/* similar sensors: 0 - calculate separately, 1 - sum up values */
		"min_speed":<text>,	/* minimal speed, km/h */
		"prev_msg_diff":<text>, /* this flag allows to form boundaries for the current value according to previous value(prev) in such a way: [prev+lower_bound ; prev+upper_bound] -- so boundaries for current value is always relative to previous value; 0 - disable this option, 1 - enable option */
		"reversed":<text>,	/* trigger: 0 - in specified range, 1 - out of specified range */
		"sensor_name_mask":<text>,	/* sensor name mask */
		"sensor_type":<text>,	/* sensor type */
		"upper_bound":<text>	/* sensor value to */
	}
}

Alarm button trigger

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

Digital input activation/deactivation

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

Message parameter control

"trg":{
	"t":"msg_param",	/* control type */
	"p":{
		"kind":<text>,		/* type of parameter control */
		"lower_bound":<text>,	/* parameter value from */
		"param":<text>,		/* parameter name */
		"text_mask":<text>,	/* text mask */
		"type":<text>,		/* trigger: 0 - trigger in specified range, 1 - trigger out of specified range */
		"upper_bound":<text>	/* parameter value to */
	}
}

Types of parameter control:

Sensor value control

"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 to form boundaries for the current value according to previous value(prev) in such a way: [prev+lower_bound ; prev+upper_bound] -- so boundaries for current value is always relative to previous value; 0 - disable this option, 1 - enable option */
		"sensor_name_mask":<text>,	/* sensor name mask */
		"sensor_type":<text>,		/* sensor type */
		"type":<text>,			/* trigger: 0 - in specified range, 1 - out of specified range */
		"upper_bound":<text>		/* sensor value to */
	}
}

Connection or coordinates loss

"trg":{
	"t":"outage",		/* control type */
	"p":{
		"time":<text>,		/* time interval, sec */
		"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 loss, 1 - connection lost and restored, 2 - connection restored */
		"geozones_type":<text>, /* control type: 0 - out of geofence, 1 - in geofence */ 
		"geozones_list":<text>  /* geofences ID's list, separated by comma */
	}
}

Idles

"trg":{
	"t":"speed",		/* control type */
	"p":{
		"lower_bound":<text>,		/* sensor value from */
		"max_speed":<text>,		/* maximal speed, km/h */
		"merge":<text>,			/* similar sensors: 0 - calculate separately, 1 - sum up values */
		"min_idle_time":<text>,		/* minimal idle time, min */
		"min_speed":<text>,		/* minimal speed, km/h */
		"prev_msg_diff":<text>,         /* this flag allows to form boundaries for the current value according to previous value(prev) in such a way: [prev+lower_bound ; prev+upper_bound] -- so boundaries for current value is always relative to previous value; 0 - disable this option, 1 - enable option */
		"reversed":<text>,		/* trigger: 0 - in specified range, 1 - out of 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>  	/* geofences ID's list, separated by comma */
	}
}

SMS control

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

Interposition of units

"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>,		/* maximal speed, km/h */
		"min_speed":<text>,		/* minimal speed, km/h */
		"reversed":<text>,		/* trigger: 0 - in specified range, 1 - out of specified range */
		"prev_msg_diff":<text>,         /* this flag allows to form boundaries for the current value according to previous value(prev) in such a way: [prev+lower_bound ; prev+upper_bound] -- so boundaries for current value is always relative to previous value; 0 - disable this option, 1 - enable option */
		"radius":<text>,		/* radius, m */
		"type":<text>,			/* check type: 0 - control approaching to units, 1 - control moving away from units */
		"unit_guids":<text>,		/* IDs of control units (comma-separated) */
		"include_lbs":<uint>,		/* process LBS messages: 1 - yes, 0 - no  */
		"lo":<text>			/* logic operator (optional): "AND", "OR" */
	}
}

Excess of messages

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

Route control

"trg":{
	"t":"route_control",		/* control type */
	"p":{
		"mask":<text>,			/* route name mask */
		"round_mask":<text>,		/* round name mask */
		"schedule_mask":<text>,		/* schedule name mask */
		"types":<text>			/* types of route control (comma-separated) */
	}
}

Types of route control:

Driver control

"trg":{
	"t":"driver",		/* control type */
	"p":{
		"driver_code_mask":<text>,	/* driver code mask */
		"flags":<text>			/* control type: 1 - driver assignment,  2 - driver reset */
	}
}

Trailer control

"trg": {
	"t": "trailer",		/* control type */
	"p": {
		"driver_code_mask": <text>,	/* trailer code mask */
		"flags": <text>			/* control type: 1 - trailer binding, 2 - trailer unbinding */
	}
}

Maintenance

"trg":{
	"t":"service_intervals",	/* control type */
	"p":{
		"days":<text>,			/* days interval */
		"engine_hours":<text>,		/* engine hours interval, h */
		"flags":<text>,			/* maintenance control flags */
		"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: