Send subgraph-driven webhooks
Receive real-time HTTP POST requests based on your subgraphs.
Power Discord notifications, back-end operations, orderbooks, and more with webhooks for subgraphs. Receive real-time HTTP POST requests to your backends whenever a subgraph indexes a new event. Every project has webhooks enabled by default for free.
Let’s speed-run a simple example of a webhook. We’ll create a webhook that sends a POST request to a URL of your choice whenever a trade occurs on the X2Y2 exchange.
What you’ll need
-
One or more subgraphs in your project - this can be from community subgraphs, a deployed subgraph, or a no-code subgraph.
-
A webhook handler; making a fully functional webhook handler is out of scope for this walkthrough so we’ll be using a test platform called Webhook.site.
Walkthrough
Deploy subgraph
Use Messari’s x2y2 subgraph to the x2y2 exchange.
Create webhook handler
Let’s use a pre-made webhook handler by going to webhook.site and copying the URL. It may look like something like https://webhook.site/<YOUR-UNIQUE-WEBHOOK-SITE-ID>
Don’t use format https://webhook.site/#!/<YOUR-UNIQUE-WEBHOOK-SITE-ID>
Any new webhook can be sent to this URL and we’ll be able to see and inspect the request body.
Create webhook
Create a webhook to receive x2y2 trades.
A secret will be generated for you to use in your webhook handler. This secret is used to authenticate the webhook request. You can ignore it for the purposes for this speed run.
Test webhook
Inspect the webhook.site URL (or your custom handler) again, you should see events start to stream in.
Can't find what you're looking for? Reach out to us at support@goldsky.com for help.
Was this page helpful?