Last updated 1 year ago
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); });
{ "id": "bb103366-7555-4a62-9270-a46990582020", "url": "https:/google.com", "walletAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp", "valid": true, "triggers": [], "createdAt": "2023-02-16T02:53:40.457843+00:00", "updatedAt": "2023-02-16T02:53:40.457843+00:00" }
This endpoint allows you to create a new Webhook.
Encoded URL for the callback endpoint.
Returns the created Webhook
const response = await fetch('https://api.underdogprotocol.com/v2/webhooks', { method: 'POST', headers: { "Authorization": "Bearer JWT", "Content-Type": "application/json" }, body: JSON.stringify({ "url": "text", "triggers": [ "CLAIM_BADGE" ] }), }); const data = await response.json();
{ "id": "text", "url": "text", "walletAddress": "text" }