So I have created a Calendly webhook that fetches an appointment as soon as it's created by the user,
The webhook works when I create an ngrok link but doesnt when io'm using my heroku staging link
So this is the webhook
//Create a new webhook
axios({
method: 'post',
url: 'https://api.calendly.com/webhook_subscriptions',
headers: {
'Authorization': `Bearer ${accessToken}`,
},
data: {
url: '/calendly-webhook',
events: ['invitee.created'],
organization:'https://api.calendly.com/organizations/ABCDEFG',
scope: 'organization',
}
})
.then(response => {
console.log('Webhook created:', response.data);
})
.catch(error => {
console.error('Webhook creation failed:', error.response.data);
})
this webhook gets the data and passes it to this endpoint
app.post('/calendly-webhook', async (req, res) => {
const data = req.body;
res.send(data);
......
});
The code was functioning properly on both localhost and Heroku staging earlier today, but now it's not working on Heroku staging without any error logs, which is unusual. I'm unsure if this is a common issue on Heroku and I'm looking for solutions since the code works fine when tested on ngrok on localhost.