Underdog Protocol
  • API Documentation
  • Quickstart
  • Guides
    • Postman
    • Endpoints
    • Authentication
    • Pagination
    • Errors
    • Webhooks
    • Architecture
  • Resources
    • Projects
      • Transferable Projects
      • Non-Transferable Projects
      • NFTs
        • List all NFTs
        • Search NFTs
        • Create an NFT
        • Retrieve an NFT
        • Update an NFT
        • Generate Claim Link
        • Revoke an NFT
        • Burn an NFT
      • Methods
        • List all Projects
        • Create a Project
        • Retrieve a Project
        • Update a Project
        • Retrieve Project Stats
    • NFTs
      • Retrieve an NFT
      • Generate Claim Transaction
    • Orgs
      • List all Orgs
    • Transactions
      • List all Transactions
      • Retrieve a Transaction
    • Webhooks
      • List all Webhooks
      • Create a Webhook
      • Delete a Webhook
    • V1
      • Collections
        • List all Collections
        • Create a Collection
        • Retrieve a Collection
      • NFTs
        • List all NFTs
        • Create an NFT
        • Retrieve an NFT
        • Update an NFT
      • Managed NFTs
        • Claim
        • Revoke
  • Examples
    • Zapier Integrations
      • Zapier + Viral Loops
      • Zapier + Github + OpenAI
      • Zapier + Github
      • Zapier + Mailchimp
      • Zapier + Shopify
      • Zapier + Calendly
      • Zapier + Hubspot
      • Zapier + Typeform
    • Underdog with Airtable
      • Create a Project
      • Create NFT on Form Submission
      • Send a Claim Link
      • Updating NFTs
    • Web3 Blog
    • Mint NFTs on iPhone
  • Use Cases
    • Solana Mobile
    • Parcl
Powered by GitBook
On this page
  1. Resources
  2. Webhooks

Create a Webhook

PreviousList all WebhooksNextDelete a Webhook

Last updated 2 years ago

Example

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"
}
  • POSTCreate a Webhook
  • Example

Create a Webhook

post

This endpoint allows you to create a new Webhook.

Authorizations
Body
urlstringRequired

Encoded URL for the callback endpoint.

Responses
201
Returns the created Webhook
application/json
401
Unauthorized
application/json
post
POST /v2/webhooks HTTP/1.1
Host: api.underdogprotocol.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "url": "text",
  "triggers": [
    "CLAIM_BADGE"
  ]
}
{
  "id": "text",
  "url": "text",
  "walletAddress": "text"
}