Get Incidents History

GET /node/api/incident-history

Returns an array of incidents history records available to a current user.

Request parameters

Query parameters

Parameter

Type

Description

limit

integer

optional

The maximum number of records to be retrieved.

ownerFilter

string

optional

A filter used for owner data [?].

skip

integer

optional

The number of the first records to be skipped.

sortDirection

string

optional

The sorting direction. Possible values are asc and desc which corresponds to ascending and descending directions accordingly.

sortField

string

optional

The name of a field used to sort history records.

Response description

...

Examples

Request examples

Bash
JavaScript
NodeJS
Python
Bash
login=<...>
password=<...>
saymon_hostname=<...>
url=https://$saymon_hostname/node/api/incident-history
curl -X GET $url -u $login:$password \
-G --data-urlencode "limit=2"
JavaScript
let login = <...>
let password = <...>
let saymonHostname = <...>
let queryParams = "limit=2";
let path = "/node/api/incident-history" + "?" + queryParams;
let auth = "Basic " + btoa(login + ":" + password);
let headers = new Headers();
headers.append("Authorization", auth);
let requestOptions = {
method: "GET",
headers: headers
};
fetch(saymonHostname + path, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log("error", error));
NodeJS
const http = require("http");
let login = <...>
let password = <...>
let saymonHostname = <...>
let queryParams = "limit=2";
let path = "/node/api/incident-history" + "?" + queryParams;
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let options = {
"method": "GET",
"hostname": saymonHostname,
"headers": {
"Authorization": auth
},
"path": path
};
let req = http.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
Python
import requests
login = <...>
password = <...>
saymon_hostname = <...>
url = "https://" + saymon_hostname + "/node/api/incident-history"
params = {
"limit": 2
}
response = requests.request("GET", url, auth=(login, password), params=params)
print(response.text)

Response example

[
{
"entityId": "5e21b85b308c3c66d64e07d2",
"entityType": 1,
"type": 1,
"parentChainId": "5e21b85b308c3c66d64e07d2",
"data": "...",
"text": "No data",
"localTimestamp": 1579614817826,
"timestamp": 1579614817826,
"clearTimestamp": 1579614894499,
"id": "5e270329f5d0b555d592e938"
},
{
"entityId": "5e21b85b308c3c66d64e07df",
"entityType": 1,
"type": 1,
"parentChainId": "5e21b85b308c3c66d64e07df",
"data": "...",
"text": "No data",
"localTimestamp": 1579614817887,
"timestamp": 1579614817887,
"clearTimestamp": 1579614894504,
"id": "5e270329f5d0b555d592e939"
},
...
]