skip to Main Content

First, I have deleted my webhook:

curl "https://api.telegram.org/bot6359000876:XXX/deleteWebhook"

Then, I have set my webhook:

curl "https://api.telegram.org/bot6359000876:XXX/setWebhook?url=https://XXX.execute-api.us-east-1.amazonaws.com/development/webhook&secret_token=abc"

When I check for the X-Telegram-Bot-Api-Secret-Token in incoming request from Telegram, the header is not present.

What I am doing wrong?

2

Answers


  1. Chosen as BEST ANSWER

    It seems that Telegram does not update the "setWebhook"; I had to delete the webhook and add it again to work.


  2. Make sure x-telegram-bot-api-secret-token is in lowercase.

    This is how it works for me with telegraf.js:

    const secretToken = req.headers['x-telegram-bot-api-secret-token'];
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search