SAYMON REST API
Search…
SAYMON REST API
General
Methods
Agents [WIP]
Authentication
Bulks [?]
Classes
Configuration
Dictionaries [?]
Event Log
Flows
History Annotations
Incidents
Incident Levels
Jobs
Limits
Links
Metric Tokens [?]
MQTT
Notification Templates [?]
Get All Notification Templates
Get Notification Template Preview [?]
Restore Default Notification Template
Update Notification Template
Objects
Operations
Presets
Properties
References
Reports [?]
Scripts
Service
Stat
Stat Rules
State History
States
Tags
Users
User Groups
Models
Misc
Powered By
GitBook
Restore Default Notification Template
POST /node/api/notification-templates/:id/restore-default/:type
Restores a default notification template with the provided ID and type.
Permissions:
manage-configuration.
Request parameters
Path parameters
Parameter
Type
Description
id
string
required
The ID of a notification template to be restored.
type
string
required
The type of a notification template to be restored.
Response description
...
Examples
Request examples
Bash
NodeJS
Python
1
login
=<
..
.
>
2
password
=<
..
.
>
3
saymon_hostname
=<
..
.
>
4
template_id
=<
..
.
>
5
type
=
pack
6
url
=
https://
$saymon_hostname
/node/api/notification-templates/
$template_id
/restore-default/
$type
7
8
curl
-X POST
$url
-u
$login
:
$password
Copied!
1
const
http
=
require
(
"http"
);
2
3
let
login
=
<...>
4
let
password
=
<...>
5
let
saymonHostname
=
<...>
6
let
templateId
=
<...>
7
let
type
=
"pack"
;
8
let
path
=
"/node/api/notification-templates/"
+
templateId
9
+
"/restore-default/"
+
type
;
10
let
auth
=
"Basic "
+
Buffer
.
from
(
login
+
":"
+
password
).
toString
(
"base64"
);
11
12
let
options
=
{
13
"method"
:
"POST"
,
14
"hostname"
:
saymonHostname
,
15
"headers"
:
{
16
"Authorization"
:
auth
17
},
18
"path"
:
path
19
};
20
21
let
req
=
http
.
request
(
options
,
function
(
res
)
{
22
let
chunks
=
[];
23
24
res
.
on
(
"data"
,
function
(
chunk
)
{
25
chunks
.
push
(
chunk
);
26
});
27
28
res
.
on
(
"end"
,
function
(
chunk
)
{
29
let
body
=
Buffer
.
concat
(
chunks
);
30
console
.
log
(
body
.
toString
());
31
});
32
33
res
.
on
(
"error"
,
function
(
error
)
{
34
console
.
error
(
error
);
35
});
36
});
37
38
req
.
end
();
Copied!
1
import
requests
2
3
login
=
<
...
>
4
password
=
<
...
>
5
saymon_hostname
=
<
...
>
6
template_id
=
<
...
>
7
type
=
"pack"
8
url
=
"https://"
+
saymon_hostname
+
"/node/api/notification-templates/"
+
\
9
template_id
+
"/restore-default/"
+
type
10
11
response
=
requests
.
request
(
"POST"
,
url
,
auth
=
(
login
,
password
))
12
print
(
response
.
text
)
Copied!
Response example
1
{
2
"template": "Всего {{eventsCount}} событий по {{uniqueCount}} объектам/связям c {{fromTime}} по {{toTime}}."
3
}
Copied!
Previous
Get Notification Template Preview [?]
Next
Update Notification Template
Last modified
2yr ago
Copy link
Contents
POST /node/api/notification-templates/:id/restore-default/:type
Request parameters
Path parameters
Response description
Examples
Request examples
Response example