Skip to content

Instantly share code, notes, and snippets.

@bdcorps
Last active Nov 16, 2021
Embed
What would you like to do?
Trigger Zapier Webhook from Node.js
// using axios
const axios = require('axios');
export const notifyWebhook = async (url, body) => {
const res = await axios
.post(url, body, {
Accept: "application/json",
"Content-Type": "application/json"
})
}
// using fetch
export const notifyWebhook = async (url, body) => {
const res = await fetch(url, {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({ body }),
});
console.log(res.json())
};
// notifyWebhook("https://hooks.zapier.com/hooks/catch/9939273/bds3d2n", {user: "saasbase"});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment