Configure Webhooks
Use incoming webhooks to get real-time updates
To start activating your webhooks events, users can follow these next steps:

After that, can click on Add webhook endpoint in order to create a new webhook subscription.

Creating a webhook endpoint is no different from creating any other page on your website. It’s an HTTP or HTTPS endpoint on your server with a URL.
Set up an HTTP endpoint on your local machine that can accept unauthenticated webhook requests with a POST method. For example, this route in Flask is a map to a Python webhook function:
@app.route('/bloock_ethereum_mainnet', methods=['POST'])
def webhook():
ethereum_mainnet_payload = request.json
In this example, the /bloock_ethereum_mainnet route is configured to accept only POST requests and expects data to be delivered in a JSON payload.
The following information must be provided:
- Event Listening: You must select the type of network you want to listen to. For example, if I subscribe to core.ethereum_mainnet webhook, every time a new anchor is confirmed on this network, will fire an event. It's important to differentiate between the core and core-test prefix. The first indicates we are listening a production environment event and the second reference to a test environment event.

Once all the information required is filed in, click on Create button.
It is important that you know the request's structure that we send to your API endpoint. Each event is structured with a webhoook_id, request_id, type, created_at and related Bloock resource nested under data. Your endpoint must parse the payload of each event.
- Header: data (timestamp) and signature (HMAC SHA256).
t=1672761735,v1=8071c487388bd9eba106fccd42e2842c58000f722f9147b6d27440a4bd9bf5c4
- Payload
{
"webhook_id": "7518043d-4774-4305-b5c9-3868e129123a",
"request_id": "fe0c1d29-8b7f-11ed-85ce-0242ac190005",
"type": "core.bloock_chain",
"created_at": 1672761735,
"data": {
"created_at": 1672735289,
"finalized": true,
"id": 102217,
"message_count": 1,
"network": {
"anchor_id": 102217,
"created_at": 1672735355,
"name": "bloock_chain",
"status": "Confirmed",
"test": false,
"tx_hash": "0x7ca9e361c9a7b4fbf4b3c2ac709d06fa8ae9e0acd648dc3a364bf9d29a39e18a"
},
"root": "b068d911852f369cd09f4ebb1bb8c037cd9f28852976934fdb4358945759ad7c",
"test": false
}
}
Your endpoint must quickly return a successful status code (2xx) prior to any complex logic that could cause a timeout.
Use webhook signatures to verify that Bloock generated a webhook request and that it didn’t come from a server acting like Bloock.
Once your webhook is created, you should see it in your webhook list. You will see your webhook's details, including: the URL, the event that you’re listening, and its status (either Active or Disabled).
Note: It is important to understand how our system manages events failures. When a webhook is created, its default status is Active. However, this status can be changed to Disabled if we detect a persistent system failure. This happens if a series of failed responses are registered when we communicate with the API endpoint provided from your side.

To check for your webhook information, click the See details button.

In this section, you’ll see the URL, Status and the Signing Secret. The Signing Secret is what will help you validate the HMAC SHA256 signature which is used to verify all the webhook requests provided from BLOOCK.

Every time we send you a new webhook event, Bloock provides you with a webhook attempts logger. With this function, you can check the webhook’s response.
At the top of the logger, you’ll find a Combobox filter where you can check all your webhook responses according to their status: Success or Error.
In detail, for each webhook, you will be provided with:
- Request ID
- Status: the status code response from your API endpoint listener.
- Time: the time when we send the request to your API endpoint.
- Result: the method request (GET, POST ...)
- Endpoint: the API endpoint URL provided when the webhook was created.
- Request body: the request body we send.
- Response body: the response from your body.

To delete or unsubscribe from a webhook event, go back to your webhook list, and choose the Delete button.

Finally, click the Delete button on the popup and the webhook will be erased.


Last modified 4mo ago