Notifications: create, edit, delete, disable/enable

To create, edit or delete notifications, use the command resource/update_notification:

svc=resource/update_notification&params={"itemId":<long>,
					 "id":<long>,
					 "callMode":<text>,
					 "e":<uint>,
					 "n":<text>,
					 "txt":<text>,
					 "ta":<uint>,
					 "td":<uint>,
					 "ma":<uint>,
					 "mmtd":<uint>,
					 "cdt":<uint>,
					 "mast":<uint>,
					 "mpst":<uint>,
					 "cp":<uint>,
					 "fl":<uint>,
					 "tz":<int>,
					 "la":<text>,
					 "un":[<long>],
					 "sch":{	
						"f1":<uint>,
						"f2":<uint>,
						"t1":<uint>,
						"t2":<uint>,
						"m":<uint>,
						"y":<uint>,
						"w":<uint>
					 },
					 "ctrl_sch":{
						"f1":<uint>,
						"f2":<uint>,
						"t1":<uint>,
						"t2":<uint>,
					 	"m":<uint>,
					 	"y":<uint>,
					 	"w":<uint>
					 },
					 "trg":{	
						"t":<text>,
						"p":{	
							<text>:<text>,
							...
						}
					 },
					 "act":[	
						{
							"t":<text>,
							"p":{	
								<text>:<text>,
								...
							}
						}
					 ]}

Parameters

Name Description
itemId resource ID
id notification ID (0 to create)
callMode action: create, update, delete, enable
e only for “enable” callmode: 1 - enable, 0 - disable

Other parameters are required only for creating and updating, you can see them in the chapter Notifications: detailed information.

Response

On create and edit:

[
	<long>,		/* notification ID */
	{
		"id":<long>,	/* notification ID */
		"n":<text>,	/* name */
		"txt":<text>,	/* notification text */
		"ta":<uint>,	/* activation type (UNIX format) */
		"td":<uint>,	/* deactivation time (UNIX format) */
		"ma":<uint>,	/* maximal alarms count (0 - unlimited) */
		"fl":<uint>,	/* notification flags */
		"ac":<uint>,	/* executions count */
		"un":[<long>],	/* array of units/unit groups ID's */
		"act":[<text>],	/* actions */
		"trg":<text>,	/* control type */
		"trg_p":{},	/* control settings */
		"crc":<long>,	/* check sum of binary representation of notification */ 
		"ct":<uint>,    /* creation time */  
		"mt":<uint>     /* last modification time */
	}
]

Notification flags as well as action and control types are described in the chapter Notifications: detailed information.

On delete:

[
	<long>,		/* notification ID */
	null
]
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2019 Gurtam