Get Comments List for Historic Incident
Returns comments list for a historic incident with the given ID.
To get a comments history for an active incident, use the Get Incident Comment History request.
Request
Response
Response contains the comments history for the given historic incident. See the Incident comment model page for all returned fields.
Examples
-
Bash
-
JavaScript
-
NodeJS
-
Python
login=<...>
password=<...>
saymon_hostname=<...>
incident_id=<...>
url=https://$saymon_hostname/node/api/incident-history/$incident_id/comments
curl -X GET $url -u $login:$password
let login = <...>
let password = <...>
let saymonHostname = <...>
let incidentId = <...>
let path = "/node/api/incident-history/" + incidentId + "/comments/;
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));
const http = require("http");
let login = <...>
let password = <...>
let saymonHostname = <...>
let incidentId = <...>
let path = "/node/api/incident-history/" + incidentId + "/comments";
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();
import requests
login = <...>
password = <...>
saymon_hostname = <...>
incident_id = <...>
url = "https://" + saymon_hostname + "/node/api/incident-history/" + \
incident_id + "/comments/
response = requests.request("GET", url, auth=(login, password))
print(response.text)
Response
[
{
"incidentId": "58ac5032c7c8dbda32afb374",
"text": "Last comment",
"author": "62c2f3ce80c8654892764d56",
"timestamp": 1687531681361,
"id": "6495b0b380b6e862cf2f64b7"
}
...
{
"incidentId": "58ac5032c7c8dbda32afb374",
"text": "Second comment",
"author": "55e59fbe7d0ce76f660607b7",
"timestamp": 1687530844658,
"id": "6495b09980b6e862cf2f64a8"
},
{
"incidentId": "58ac5032c7c8dbda32afb374",
"text": "First comment",
"author": "62c2f3ce80c8654892764d56",
"timestamp": 1687530832351,
"id": "6495ad5c80b6e862cf2f633f"
}
]