Verification request

Kacper Wiacek Product Expert Lead
Kacper Wiacek
2 min read
updated: Apr 13, 2023

Learn how to handle the verification request in ChatBot and secure your data.ย 

What is a verification request?Link icon

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, the verification request is sent to your backend. You should answer this request by returning the required parameters and confirming that the request comes from a trusted source and itโ€™s configured properly.

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

How does verification work in ChatBot?Link icon

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 which you can set when you create a new webhook in ChatBot.

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.

Example code to handle verification requestLink icon

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โ€™ll be able to add your webhook to ChatBot. If you want to learn more about setting up your first webhook, check out this article.

TroubleshootingLink icon

During the configuration process, you may encounter some problems with adding the webhook to your ChatBot account. The most popular ones, along with their possible origins, are listed in this article.

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