Mattia
Mattia

Reputation: 6534

Telegram webhook not found even though it exists

I can't figure out why the Telegram API says that the webhook.php doesn't exist even though I can access it using a browser.

Telegram API:

{"ok":false,"error_code":404,"description":"Not Found"}

The link:

https://api.telegram.org/56014xxxx:AAxxxxxxxxxxxxxxxxxxxxxxx/setWebhook?url=https://hexah.net/Telegram/webhook.php

Upvotes: 0

Views: 3423

Answers (3)

Mattia
Mattia

Reputation: 6534

At the end the issue was that the URL need to be encoded

https://api.telegram.org/botxxxx:xxxx/setWebhook?url=https%3A%2F%2Fwww.hexah.net%2FTelegram%2Fwebhook.php

(Thanks who help me on the Telegram Bot Channel)

but I still don't understand why my old link was working fine without encoding...

Upvotes: 1

Sean Wei
Sean Wei

Reputation: 8013

Please try this URL format instead:

https://api.telegram.org/bot56014xxxx:AAxxxxxxxxxxxxxxxxxxxxxxx/setWebhook?url=https://hexah.net/Telegram/webhook.php

Upvotes: 4

Lars Dormans
Lars Dormans

Reputation: 170

It seems you incorrectly authorized your bot/application see https://core.telegram.org/bots/api#authorizing-your-bot

Upvotes: 0

Related Questions