Webhook
Last updated
Was this helpful?
Last updated
Was this helpful?
Outcode fundamentally supports Webhooks to help you utilize data.
Endpoint URL : This is the Webhook URL address. To enable execution, set the webhook status to ON and save the workflow.
// Webhook URL
const webhook_url = https://core.outcode.biz/outcode/webhook?key=123456;
// Data Payload
const payload = {
"name": "Roy",
"org": "Outcode"
};
// Request to Outcode Webhook
fetch(webhook_url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(result => {
console.log('Success : ', result);
})
.catch(error => {
console.error('Error : ', error);
});
200: Successfully called the webhook.
400: Bad request.
401: Failed to authenticate the API key.
423: The free service has ended.
500: The server encountered an issue and was unable to process the request.
When referencing data received via a webhook in a task, it is done as follows:
The default reference value for a webhook is trigger.body
. The data sent through the webhook exists as a child of this object.
For example, if the data sent via webhook is:
{ "name": "Roy" }
Then the reference value should be specified as trigger.body.name
.
If an error occurs during task execution, please check the keys or values of the object.