Official Documentation
mailerlite.webhooks.get()
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});
Official Documentation
mailerlite.webhooks.find("WEBHOOK_ID")
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});
Official Documentation
const params = {
name: "Test webhook",
events: ["subscriber.updated"],
url: "http://www.marvin.com/omnis-accusamus-est-rem-delectus-quaerat.html"
};
mailerlite.webhooks.create(params)
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});
Official Documentation
const params = {
name: "Test webhook updated",
enabled: false
};
mailerlite.webhooks.update(params)
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});
Official Documentation
mailerlite.webhooks.delete("WEBHOOK_ID")
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) console.log(error.response.data);
});