Hi,
I want to set a API script alert to test if the API is working fine. i wrote the following code to but when i bring the API down it is not sending any alert. Could you please tell me what am i doing wrong. its more than 2 API url that i need to monitor.
const request = require(‘request’);
request(‘https:API_URL_1’, { json: true }, (err, res, body) => {
if (err) throw new Error(err);
console.log(res.body);
});
request(‘https:API_URL_2’, { json: true }, (err, res, body) => {
if (err) throw new Error(err);
console.log(res.body);
});