Sending data to a webhook
How to send data to a webhook on Palabra
const request = require('request-promise-native')
const userValidatedEmail = async ({ email }) => {
//.. app specific logic after user validates email
// sending request to webhook
const response = await request({
// get uri from https://a.palabra.io
uri: 'https://hooks.palabra.io/webhook?id=[UNIQUE-ID]',
method: 'POST',
body: {
email // required
},
json: true
})
if (!response) {
throw new Error('Error triggering webhook')
}
}Last updated
Was this helpful?