Published on

How to listen for Webhook

Authors

image

How to listen for Webhook

In this example, we are going to create a workflow that will gets triggerred whenever a new event is emitted from smart contract through Moralis Stream, and post a message to Discord channel.

What is Moralis?

Moralis provides world-class APIs to developers across the globe, allowing companies and projects of all sizes to seamlessly integrate blockchain into their solutions stack and scale with ease.

Moralis Stream is a feature that stream blockchain data into your backend via webhooks.

Workflow Configuration

The workflow template can be copy paste onto Outerbridge canvas, but there are some input parameters that need to be configured.

Discord node

  • Change the Webhook URL to the channel you would like to post the message. Official guide from Discord: Making a Webhook

image

Webhook node

  • Nothing needs to be changed. Just copy the URL onto clipboard.

image

Click Save -> Deploy. You now have a workflow ready to listen for webhook, now let's setup the webhook.

Moralis Webhook Setup

You can follow the tutorial below:

In the Webhook URL section, fill in the URL you have copied from Outerbridge Webhook node.

image

Test Workflow

Navigate to the block explorer page of the contract you just deployed, connect to your wallet, and execute the function. In this case, the deployed smart contract has a function named newDonation, let's enter a value and write the transaction.

image

Voila! You should receive a new Discord message 🥳

image