API: Alert Group operations

Alert Group: JSON Object
JSON Example

{
“Id”: 613,
“Name”: “Notification Group”,
“Scheduler_Id”: 0,
“Addresses”: [{
“Address”: “alerts@company.com”,
“Template_Id”: 0,
“Type”: “Email”
}, {
“Number”: “0111234567”,
“Template_Id”: 0,
“Type”: “Sms”
}, {
“WirelessDeviceEmail”: “wireless@company.com”,
“Template_Id”: 0,
“Type”: “Wireless”
}],
“Assigned_To”: [8533, 8534] }

Fields description 

Field Type Description
Id

Int32

Unique Notification group ID

Example:

“Id”: 613

Name

String

Notification Group name

Example:

“Name”: “Notification Group”

Scheduler_Id

Int32

ID of a scheduler assigned to a notification group. “0” value means there is no scheduler assigned to a group.

Example:

“Scheduler_Id”: 0

Addresses

Array of Objects

Possible Types of notification addresses are:“Email”, “Script”, “Phone”, “Snmp”, “Pager”, “Sms”, “Wireless”.Each notification address type has its own set of fields.

“Email” Example:
{
 "Address": "alerts@company.com",
 "Template_Id": 0,
 "Type": "Email"
}
“Script” Example:
{
 "File": "url_executor.cs \"address.com\"",
 "Template_Id": 0,
 "Type": "Script"
}
“Phone” Example:
{
 "Code": "011",
 "Number": "1234567",
 "Template_Id": 0,
 "Type": "Phone"
}
“Snmp” Example:
{
 "Community": "public",
 "Host": "127.0.0.1",
 "Template_Id": 0,
 "Type": "Snmp"
}
“Pager” Example:
{
 "Code": "777",
 "Number": "12345678",
 "Message": "123456789",
 "Template_Id": 0,
 "Type": "Pager"
}
“Sms” Example:
{
 "Number": "0111234567",
 "Template_Id": 0,
 "Type": "Sms"
}
“Wireless” Example:
{
 "WirelessDeviceEmail": "wireless@company.com",
 "Template_Id": 0,
 "Type": "Wireless"
}
Assigned_To

Array containing int32

This array contains list of device ids where notification group was assigned.

Example:
"Assigned_To": [8533, 8534,9756]

The following actions can be performed with Alert Groups:

Create new Notification Group

Notification Group can be created using two methods:

PUT on the following URI : /groups
POST on the following URI: /groups?verb=PUT
PUT / POST Content example (formatted):

{
“Name”: “Notification Group”,
“Scheduler_Id”: 0,
“Addresses”: [{
“Address”: “email@company.com”,
“Template_Id”: 0,
“Type”: “Email”
}, {
“Code”: “011”,
“Number”: “1234567”,
“Template_Id”: 0,
“Type”: “Phone”
}, {
“Code”: “777”,
“Number”: “12345678”,
“Message”: “123456789”,
“Template_Id”: 0,
“Type”: “Pager”
}, {
“Number”: “0111234567”,
“Template_Id”: 0,
“Type”: “Sms”
}],
}

Success Response:

{
“Success”:true,
“Result”:637
}

Delete Alert Group

Alert Group can be deleted using 2 methods:

DELETE on the following URI : /group/{group_id}
POST on the following URI: /group/{group_id}?verb=delete
Success Response:

{
“Success”:true,
“Result”:”Group 638 has been deleted”
}

Get list of Notification Groups

GET URI:

/groups
Success Response:
[608,609,610,611]
Get Notification Group info

GET URI:

/Group/{groupid}
Success Response:

{
“Id”: 613,
“Name”: “Notification Group”,
“Scheduler_Id”: 0,
“Addresses”: [{
“Address”: “email@company.com”,
“Template_Id”: 0,
“Type”: “Email”
}, {
“File”: “script.cs \”parameter\””,
“Template_Id”: 0,
“Type”: “Script”
}, {
“Code”: “011”,
“Number”: “1234567”,
“Template_Id”: 0,
“Type”: “Phone”
}, {
“Community”: “public”,
“Host”: “127.0.0.1”,
“Template_Id”: 0,
“Type”: “Snmp”
}, {
“Code”: “777”,
“Number”: “12345678”,
“Message”: “123456789”,
“Template_Id”: 0,
“Type”: “Pager”
}, {
“Number”: “0111234567”,
“Template_Id”: 0,
“Type”: “Sms”
}, {
“WirelessDeviceEmail”: “wireless@company.com”,
“Template_Id”: 0,
“Type”: “Wireless”
}],
“Assigned_To”: [8533, 8534] }