const axios = require('axios');
const url = "https://incident-query.api.pinghome.io/default/v1/health-check";
axios.get(url)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = 'https://incident-cmd.api.pinghome.io/default/v1/team/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/incident';
const data = {
name: "Incident name",
description: "Incident description",
urgency: "medium",
assignees: [
{
type: "team",
id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed"
}
],
actions: [
{
type: "trigger-alerts",
settings: [
{
status_page_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed",
component_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed"
}
]
}
]
};
axios.post(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
const axios = require('axios');
const url = 'https://incident-cmd.api.pinghome.io/default/v1/incident/445a5c1f-c0eb-403a-96d7-3976e5dc74ed';
const data = {
name: "Incident name",
description: "Incident description",
urgency: "medium",
assignees: [
{
type: "team",
id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed"
}
],
actions: [
{
id: "",
type: "trigger-alerts",
settings: [
{
id: "",
status_page_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed",
component_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed"
}
]
}
]
};
axios.put(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});