What is a verification request

Image of an author
Dariusz Zabrzenski
1 min read
updated: Apr 4, 2022

Verification request provides the security for your bot and data.

When you create a new webhook, you receive the verification request. You should answer to this request by returning required parameters to confirm that request comes from a trusted source and it’s configured properly.

OverviewLink icon

Verification request is sent by ChatBot, which uses the GET request while adding a new webhook and contains two parameters:

  • challenge - it’s a random string

  • token - verification token set in the application while setting up the webhook

How to handle vertification request?Link icon

You should return the value of the parameter challenge and verify the token entered in ChatBot.

While configuring new webhook, ChatBot sends verification request to ensure that your webhook is authentic and working.

Example code to handle verification requestLink icon

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
    return res.end(req.query.challenge);
});

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