Create a Webhook
This endpoint allows you to create a new Webhook.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
urlstringRequired
Encoded URL for the callback endpoint.
Responses
201
Returns the created Webhook
application/json
401
Unauthorized
application/json
post
/v2/webhooksExample
curl --location 'https://dev.underdogprotocol.com/v2/webhooks' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"url": "https:/google.com",
"triggers": []
}'const axios = require('axios');
let data = JSON.stringify({
"url": "https:/google.com",
"triggers": []
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://dev.underdogprotocol.com/v2/webhooks',
headers: {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Last updated