Setting your Telegram Bot WebHook the easy way

In order to make your Bot answering to requests from your Telegram users you need to manually request for updates to the Bot API or you can register a WebHook to automatically being called once updates are available.

The latter is a better and more efficient solution.

That being said, the quickest and easiest way to set a WebHook for your Bot is to issue a GET request to the Bot API (it’s enough to open an url in your browser).

All you have to do is to call the setWebHook method in the Bot API via the following url:{my_bot_token}/setWebhook?url={url_to_send_updates_to}


  • my_bot_token is the token you got from BotFather when you created your Bot
  • url_to_send_updates_to is the url of the piece of code you wrote to implement your Bot behavior (must be HTTPS)

For instance:

And you’ve got it.

Now if you go to the following url (you have to replace {my_bot_token} with your Bot Token){my_bot_token}/getWebhookInfo

you should see something like this:


For a complete list of parameters for the setWebHook method have a look at the official API reference.

This story is also available on (in italian).

Written by

Freelance, mobile developer, software craftsman, guitar strummer, husband, father, humble.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store