Introduction
Client Sites in the TrackTik portal have a tab called Notifications. These are to configure the destinations and triggers of reports notifications.
And for each of these, triggers and destinations can be defined (for who they should be sent to). These two are known as Filters and Recipients, respectively.
API endpoints now exist to allow for the creation, editing and removal of these notifications along with their filters and recipients.
Terminology
Web Portal vs API
|
TrackTick Web Portal |
API |
Definition |
|---|---|---|
|
Notification Rule |
VIEW |
The title and email type + body content of the notification. |
|
Filters |
VIEW CREATE/UPDATE |
The triggers and context of when to generate a notification, like report templates, severity, flag types and flags (categories). |
|
Recipients |
VIEW CREATE/UPDATE |
Who should receive the notification, like site contacts, site employees, site clients and zone employees. |
Payload Examples
Create a Rule Notification
[POST] /filter-rule-set-reports
{
"trigger": "TRIGGER.APPROVAL",
"ruleName": "Scenario 2 - Scenario 1 but from API",
"account": 687,
"applyToSubSites": false,
"emailTemplate": "CUSTOM",
"emailSubject": "default subject",
"emailBody": "default body",
"emailIncludeAttachment": true
}
Add/Update Filters to a Rule Notification
[POST] /filter-rule-set-reports/{id}/actions/add-filters
{id}: the id of the filter-rule-set-report record
{
"id": {id},
"incidentSeverity": [1,2,3,4,5],
"incidentFlagType": [10,12,13],
"incidentFlag": [52,50,56],
"sendAll": false
}
Add/Update Recipients to a Rule Notification
[POST] /filter-rule-set-reports/{id}/actions/add-recipients
{
"id":{id},
"siteContacts": [id1,id2,id3,..,idn],
"siteEmployees":[id1,id2,id3,..,idn],
"siteClients": [id1,id2,id3,..,idn],
"zoneEmployees":[id1,id2,id3,..,idn]
}