Snooze a PagerDuty incident

Snooze a PagerDuty incident via the API

by Ryan Hoskin

HTML

<script src="https://eurica.github.io/pdjs/js/pdjs.js"></script>

JavaScript

//Snooze a PagerDuty incident via the API

PDJS = new PDJSobj({
    subdomain: "pdt-ryan",
    token: "sQ7i4FLW4AKtT8r8iG1r"
})

incident_id = "PKSSKCF";
requester_id = "PIE6ZH7";
duration = "524";
PDJS.api({
    res: "incidents/" + incident_id + "/snooze",
    type: "PUT",
    data: {
    	requester_id: requester_id,
        duration: "524"
    },
    success: function (json) {
        console.log("Snoozed " + incident_id + " for " + duration + " seconds.");
    }
})