Undo Incident Acknowledgement

Undoes an acknowledgment of an incident with the specified ID.

Request

HTTP Request

POST /node/api/incidents/:id/unacknowledge

Path parameters

Parameter Type Description

id

String
required

The ID of an incident whose acknowledgment should be undone.

Request body

The request body is empty.

Response

The response body is empty.

When you undo an acknowledgement of an incident, the acknowledgedBy and acknowledgementTimestamp fields are set to null.

If you try to undo an acknowledgement of an incident that wasn’t acknowledged before, the acknowledgedBy and acknowledgementTimestamp fields are added and set to null.

The example below shows a Get Incident by ID request returning an unacknowledged incident.

{
    "id": "636363ca86bfdcde76a733c5",
    "entityId": 816,
    "entityType": 1,
    "type": 1,
    "data": "{"packetsTransmitted":4,"packetsReceived":4,"packetLossPercentile":0,"numberOfErrors":0,"numberOfDuplicates":0,"roundTripMinimal":16.447,"roundTripAverage":16.515,"roundTripMaximum":16.606,"exitCode":0}",
    "lastState": 4,
    "localTimestamp": null,
    "parentChainId": 816,
    "reason": {
        "code": 10,
        "rootCause": {
            "entityId": "59d3572f738ffa4d56b87f32",
            "entityType": 1,
            "entityName": "Info"
        }
    },
    "state": 4,
    "text": "No data",
    "timestamp": 1667457994374,
    "acknowledgedBy": null,
    "acknowledgementTimestamp": null
}

Example

Request

  • Bash

  • JavaScript

  • NodeJS

  • Python

login=<...>
password=<...>
saymon_hostname=<...>
incident_id=<...>
url=https://$saymon_hostname/node/api/incidents/$incident_id/unacknowledge

curl -X POST $url -u $login:$password
let login = <...>
let password = <...>
let saymonHostname = <...>
let incidentId = <...>
let path = "/node/api/incidents/" + incidentId + "/unacknowledge";
let auth = "Basic " + btoa(login + ":" + password);

let headers = new Headers();
headers.append("Authorization", auth);

let requestOptions = {
    method: "POST",
    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/incidents/" + incidentId + "/unacknowledge";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");

let options = {
    "method": "POST",
    "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/incidents/" + \
    incident_id + "/unacknowledge"

response = requests.request("POST", url, auth=(login, password))
print(response.text)