Verification request

Image of an author
Sylwia Kocur
2 min read
updated: Nov 21, 2024

A verification request provides security for your bot and data by providing a secret token upon configuration.

When you try to add a new webhook, a verification request is sent to your backend. You should answer this request by returning the required parameters and confirming that it comes from a trusted source and is configured properly.

Passing the verification is required to make your webhook work in your ChatBot bot flow.
Passing the verification is required to make your webhook work in your ChatBot bot flow.

A verification request is sent by ChatBot, which uses the GET request when you add a new webhook. It contains two parameters:

  • challenge — a unique string of characters associated with your request.

  • token — a verification token that you can set when you create a new webhook in ChatBot.

See our documentation for more information on webhooks and check the object definitions.

Adjust the provided code examples to match your needs.

See our documentation for more information on webhooks and check the object definitions.

Adjust the provided code examples to match your needs.

How to handle the verification requestLink icon

To pass the verification process successfully, you should return the value of the challenge parameter and verify the token entered in ChatBot with the one set in your backend.

While configuring a new webhook, ChatBot sends a verification request to ensure that your webhook is up and running.

Verification Request
app.get('/', (req, res) => {
    // check if verification token is correct
    if (req.query.token !== 'your-token-here') {
        res.writeHead(401);
        return res.end();
    }

    // return challenge to ChatBot
    return res.end(req.query.challenge);
});

Once the verification request is handled, you can add your webhook to ChatBot. If you want to learn more about setting up your first webhook, check out this article.

You may encounter problems adding the webhook to your ChatBot account during the configuration process. This article lists the most popular ones, along with their possible origins.
You may encounter problems adding the webhook to your ChatBot account during the configuration process. This article lists the most popular ones, along with their possible origins.

Read more:

Was this article helpful?

Got it!

Thanks for your feedback.

Thank you!

We’re happy to help.

Start a free ChatBot trial
and build your first chatbot today!

Free 14-day trial No credit card required

Discover our text| products