Skip to content
Advertisement

i am getting an error when i tried to set webhook for telegram

I want to set webhook for telegram for certain user input so that telegram replied automatically to predefined question and I am able to write the program which is running perfectly fine, but when I tried to set webhook for that program it is showing an error:

{
   "ok": false,"error_code": 400,"description": "Bad Request: bad webhook: Ip is reserved"
}  

I tried to set webhook like that:

https://api.telegram.org/bot<token>/setwebhook?url=https://localhost/Manisha/bot.php  

Advertisement

Answer

You need to use a publically available URL that the Telegram servers can reach. http://localhost/ is not public.

You are trying to make an HTTP request to the computer the bot is running on.

This isn’t your server, it is Telegram’s server. It doesn’t work because:

  • Your PHP isn’t installed on it
  • Telegram won’t let your bot go poking at their internal servers
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement