> For the complete documentation index, see [llms.txt](https://blazingapp.gitbook.io/tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blazingapp.gitbook.io/tutorials/old/unique-features/webhooks-api-auto-trading.md).

# Webhooks / API Auto-trading

Web hooks in Blazing App allow you to set up automated trading using APIs.

{% embed url="<https://www.youtube.com/watch?ab_channel=BlazingBot&v=8kVeqtZJi_k>" %}

Blazing App allows you to automate your trading through its webhook API integration. This feature enables you to connect your custom buy templates with external systems, providing seamless and automated trading. Below is a step-by-step guide to setting up and using Blazing Webhooks:&#x20;

#### ⚡Fastest API buyings are available only on Blazing App.[ Sign up now.](https://web.blazingapp.com/dashboard/pro)

## How to create a Webhook

### 1. Create a Template

<div data-full-width="true"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcqYjiHjf0jRpr207YtLTlG8F6YCLyYVNmGx4_vIf3acc4WiCT0FV01-JvmO12u_nZvEt2e_RHJu-LZaLkapFzaD-RNwek0mtcVdt1mSTHBkCqlg72fYO9SWtDd-maHWHPFUSHTO1yF1o9HorPiXihlJBwX?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure></div>

To begin, you’ll need to create a template that will be used to automatically buy DRBT calls.

1. Open the [Blazing WebApp](https://web.blazingapp.com/dashboard/pro).
2. On the left-hand menu, navigate to ‘Add New Template’.
3. Select ‘Manual Buy’ as the type and enter all relevant settings.
4. Name your template.
5. Choose the wallets in your Blazing account that will be used for buying on the calls.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdEtPFNCUVbuD9QCGMeAY4vpgW-5J8vhk374EQlSDbLRYHLnjQf-sGhc65hgMz_8oHY5Rud8nwUQrsRXi4cBF8Ee99PZ9fZWBRXalICl3jFq7Gzj8tw5itz8HUVL5p9z8nlAHARWkkqQkZFlCT2BrQ9vLI?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Set the ‘Spend Amount Value’ in Ethereum (ETH) for each call.
{% endhint %}

Adjust your safety settings as needed, then click ‘Add’ to save your template.

{% hint style="info" %}
Your template is now saved and ready for use. You can find it in the left-hand menu for future edits if necessary.
{% endhint %}

### 2. Create a Webhook for the DRBT Calls

Next, we’ll create the webhook that will connect to DRBT bot:

1. Go back to the Template Settings section and select ‘Create Webhook’.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfuQ3kN9hgb15EAk5Nm9qGNl0_hsgNCjXpTDRXC-tyxnrhSih-oLbjpH8jSvuotbsmkSOd_4Jm3gt2oquKUO7NqMNQMyzZkLJIZe3ShpyjVh-CmKp3ETloqrkP08SiGg29-3F6a3SEtLmnwgnFlRmQWjTUc?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

2. Name the webhook and select the template you just created.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcZgu_SxY122_Wb8YOOTaxRbt_surLgXWE3C_tdKQaJYKMZX91TX7v0AT4-gIf_I4YaVwWAeuJWi6NEeyVvZq72uWzwdQDaI54XHgrcQevIMSBLrlWrmitq0rxYlzFROm9R_CbFPdweJ2CC7y_eOvgrNRtw?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

3. Do not close this window until the webhook setup is fully completed.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfQPX-hrUq1LNw3kQmE1cvf8Rw_I0dc3S-_sdywh4ztMVm-QHXFCaElXQ7VSOLOSc2Gl9eXsgUdfgTsnW_QMGJWFgcuz4uj450etJfEToAAFztZGb9gQAhv5rQZuhOJGtYAHuxG8eGH62k6j0iLYWcLpJY?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

#### **👉** [**Launch Blazing WebApp**](https://web.blazingapp.com/dashboard/pro) **now!**

### 3. Connect the Webhook to the DRBT Bot

Now we’ll link the webhook to the DRBT bot:

1. Copy the Webhook URL from the Blazing WebApp.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdvg24uwO8YywpfoVmxii6FENrHRDxjkMTy2huHuUC_2leCT8Man1Ij5F7imnc2SAaPbk8BVga5JFn-CVJgMGqORfemsNv-YD9PosfHKKw8wKhCNf9jf7leauy-gT2F4lI2ugs5yFMwXnjtZKiAwfvHol4?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

2. Open the DRBT Filters Bot and select the query where you want to connect the webhook.
3. Click ‘*Webhook*’ and paste the Webhook URL.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdDySFYE5f43q8eV2ru66kKbCRMMChgoY7au9c9S8QLiALXvNmRSaPRx2Wv5LPcEnW6fSfjH7SwUnaYFc4hkYH6SoMmrZXDHj8pz_-wZE_7xdUn5QhG94y_f-1AevoGOqa7VJlgrbFyd1yW95UEkoa_RcWN?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

4. Optionally, edit the query settings or rename the query for easier identification.

### 4. Activate Auto-Buy and Link Your Access Token

1. In the DRBT bot, click ‘Auto Buy’ and select ‘Blazing’.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcx54i_-hwAvVMBHjOZgjn8ANWRZOzd-Q9LYYAFH6jK1C-UOWe2evaItya9AYj5GLBCeWTbQM-ujIts5jspoilo2cJeBhh5kQUHUTeZWX1x2Ttg9F-Hl1UcKGsJFnOrHlN9ZitL_bpjhsfReYKMavjYYSs?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

2. Go back to the Blazing WebApp and copy your Access Token.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeEbN40cGyeyS8VATsiwkxnFRaHVgopiKAKG-zZVqO7uWm3VxByw2dhQZfIxOh0-eTC45XJnbW_1STCDCYrWRHHCau0-IX3jx6xS-P8YPBL1epyFfyTef24CH7AptBWY3lRBz01rCUxUuMF9PzmepTdtjZB?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

3. Return to the DRBT bot and reply with the Access Token to finalize the connection.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeGL2bpytO1XD0Nw7IqxTtsbVZuWBn5HyZhhqhu_I6kLMINjFrZGGmCMO_miwnIGcIRyQF2NP_aMLlWKdlPwQZ20_VdadV8RCu1MkJUkm9xFhv9pY4LWU-K8JeoVl5GoT_5dNG_PLIRCC6dzCIcgL3UCkKY?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

Once everything is configured, you should see the Webhook URL listed and a green check next to the ‘Sniper Key’ in the DRBT bot.

### 5. Monitoring and Confirmation

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfwqUlTX-oz_98NH1ZpMHZwjqC5rrJ2PuLVm-uq7YVEhI6yJip7b-P0XNTtPPpCC5Fmir98v-S7k2d5TjR1LghV86Olh4wWo9TOKQ2bJTokmgtSqzvuJTPptZZcqJlHYC3w0tpx8toauo5Dfe0UV_Y96Z51?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

Once a call comes through:

* You’ll receive a notification from the Blazing Telegram Bot when a call is triggered and the buy is executed.
* You can check the token that was bought on the WebApp.

#### Tracking Your Recent Buys

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfPky07DBAkWntZxVoywVJq85pkxbhQ222ZgtjPeS_iqAndY4sA62jeoHhjBf1SJV-pZNlsmJ5Ne8L8OdYCXdMm0ofh2Aru-3liPl8Wxax6THFQ9qvEZsxJQhQw6aqbxlEhUsEpc7W0f9t9tdgzkj0K0agl?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

* Navigate to the Profit & Loss (PnL) panel in the WebApp to track your recent buys.
* You can also instantly share your PnL card before selling for easy updates.

## Managing Webhooks

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfFFiuKVDvvsmsgH0foMjcRz6bMkqJAAINMVfLNg8Fb-zTBmPtY4LjVDjNawKS3YjD65PtMqb0aS6ibVe9zbrO7mTWofOZjcD7ZnWn8I9r6ax4_01MXBB3InloHzMYQ7KskXgj6VyDvbbn_r2SoGhQZBslC?key=SHc_X4gxuwSLYSgB1NwEXA" alt=""><figcaption></figcaption></figure>

To manage or update your webhooks, go to the Settings tab in the Blazing WebApp. Here, you can select a different template to be used with the webhook if needed.

#### 👉 Ready to trade? [Launch Blazing WebApp](https://web.blazingapp.com/dashboard/pro) now!

## Interact with Your Webhook

To trigger the webhook, send a `POST` request to the **Webhook URL** with the **Access Token** included as a bearer token in the headers. The endpoint requires one parameter in the request body: the contract address of the token.

Here’s an example of the request structure using `curl`:

```bash
curl -X POST 'https://dev.blazingworld.me/api/v1/order/webhook//trigger/buy?b=1&l=en'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer '
-H 'Accept: application/json'
-d '{ "contract": "0x<TOKEN_ADDRESS>" }'
```

#### Key Notes

* The `contract` parameter should contain the contract address of the token you want to interact with.
* This example is provided for illustration purposes. Replace `<ID>` and `<ACCESS TOKEN>` with the specific values generated during webhook setup.

By following these steps, you can automate your trading strategies with Blazing App's webhooks and streamline your trading experience.
