# Set Webhook Url to Receive Delivery Reports / Message Statues From Meta For Your WhatsApp API

* Go to **Channels → Webhook** and click **Add Webhook**.
* Open **webhook.site** in a new tab and click **New** to generate a test webhook.
* Click the **Edit** option and configure the response:
  * Status Code = **200**
  * Content Type = **text/html**
  * Content = **$request.query.challange$**
* Save the changes and copy the **unique webhook URL**.
* Go back to **Channels → Webhook**, paste the URL, and give your webhook a **title**.
* Select the required **channel events** (incoming messages, calls, outgoing messages, etc.).
* Click **Add Webhook** to save.
* Once confirmed, incoming webhook events will start appearing instantly.
* Make sure your **server URL responds with the challenge query**, otherwise verification will fail.

*<mark style="background-color:blue;">**It is Important that your server URL responds with the Challange Query**</mark>*

### PHP Code For Webhook Challenge Response

```
<?php
//Check if method is GET
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    //Check if query contains the challange parameter
    if (isset($_GET['challange'])) {
        //Get parameter value
        $challenge = $_GET['challange'];
        echo $challenge;
    } else {
        //No Parameter Found
        echo "no challange";
    }
}
?>
```

### Node JS Code For Webhook Challange Response

```
app.get('/your_webhook_endpoint',(req, res) => {
  try {
    res.send(req.query['challange']);
  } catch (error) {
    res.send(error.message);
  }
});
```

### Video Tutorial

{% embed url="<https://www.youtube.com/watch?v=YMjwZl6CbSI>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helpdocumentation.gitbook.io/user/messaging-channels/whatsapp-api/managing-your-whatsapp-api/set-webhook-url-to-receive-delivery-reports-message-statues-from-meta-for-your-whatsapp-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
