Telegram-bot-sdk: Check if webhook url is valid

Created on 2 May 2017  路  2Comments  路  Source: irazasyed/telegram-bot-sdk

how to check if the webhook url is valid?

Most helpful comment

Call this by GET :

https://api.telegram.org/bot/getWebhookInfo

All 2 comments

Call this by GET :

https://api.telegram.org/bot/getWebhookInfo

with getWebhookInfo only catch the info of the updates recibed, don't catch the info of the server side. For example, if I put this:
$bot->setWebhook(['url'=>'https://google.es/']);
the response of the server's Telegram said Ok : true
Then @hellosaeedalizadeh , when you do these :
$response=$bot->getWebhookInfo();
The $response contains info about the status of the webhook, but havn't a parameter wich contains info about if the domain exist or is accesible.

It can solve with a response from the server selected (for example to confirm that it's the server of your bot, if it recives a $_POST['Telegram'] , your server should response with the token of your bot to confirm that is your server)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jahanzaibbahadur picture jahanzaibbahadur  路  4Comments

jobs2008 picture jobs2008  路  3Comments

nanangkoesharwanto picture nanangkoesharwanto  路  3Comments

mccarlosen picture mccarlosen  路  3Comments

behnamazimi picture behnamazimi  路  3Comments