Can you please confirm i am responding correctly to incoming EX webhooks?
router.post('/ringEX', async (req, res) => {
console.log('\nReceived ringEX webhook event');
if (req.headers.hasOwnProperty("validation-token")) {
res.setHeader('Content-type', 'application/json');
res.setHeader('Validation-Token', req.headers['validation-token']);
}
res.status(200).end();
//… rest of code
our EX webhook is consistently going down, even though our CX webhook has never gone down (can’t be the server).
The subscription status also shows ‘Active’ even though the webhook is not firing.
Deleting and recreating the web hook immediately fixes the issue.
async function subscribe_for_notification() {
var bodyParams = {
eventFilters: ['/restapi/v1.0/account/~/telephony/sessions'],
deliveryMode: {
transportType: "WebHook",
address: DELIVERY_ADDRESS
},
expiresIn: 31536000 // 1 year
}
try {
let endpoint = "/restapi/v1.0/subscription" // don't edit this line
var resp = await platform.post(endpoint, bodyParams)
var jsonObj = await resp.json()
console.log (`Subscription Id: ${jsonObj.id}`)
console.log("Ready to receive incoming calls via WebHook.")
} catch (e) {
console.log(e.message);
}
}