Telegram.php
public function setWebhook($url, $certificate = '')
    {
        if ($certificate == '') {
            $requestBody = ['url' => $url];
        } else {
            $requestBody = ['url' => $url, 'certificate' => "@$certificate"];
        }

        return $this->endpoint('setWebhook', $requestBody, true);
    }
public function setWebhook($url, $certificate = '')
    {
        if ($certificate == '') {
            $requestBody = ['url' => $url];
        } else {
            $requestBody = ['url' => $url, 'certificate' => "@$certificate"];
        }

        return $this->endpoint('setWebhook', $requestBody, true);
    }
public function setWebhook ( $ url , $ certificate = '' ) { if ( $ certificate == '' ) { $ requestBody = [ 'url' => $ url ] ; } else { $ requestBody = [ 'url' => $ url , 'certificate' => "@$certificate" ] ; } return $ this -> endpoint ( 'setWebhook' , $ requestBody , true ) ; }
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.

If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your botâ€˜s token, you can be pretty sure itâ€™s us.
\param $url String HTTPS url to send updates to. Use an empty string to remove webhook integration
\param $certificate InputFile Upload your public key certificate so that the root certificate in use can be checked
\return the JSON Telegram's reply.
Use this method to specify a url and receive incoming updates via an outgoing webhook . Whenever there is an update for the bot we will send an HTTPS POST request to the specified url containing a JSON - serialized Update . In case of an unsuccessful request we will give up after a reasonable amount of attempts .