title: Got problems with webhook to Telegram Bot API
body: <p>Why is my webhook not working? I do not get any data from telegram bot API. Here is the detailed explanation of my problem:</p>
  
  <p>I got <strong>SSL cert from StartSSL</strong>, it works fine on my website (according to <a href="https://www.geocerts.com/ssl_checker" rel="noreferrer">GeoCerts SSL checker</a>), but still seems like my webhook to Telegram Bot API doesn't work (despite it says that webhook was set I do not get any data).</p>
  
  <p>I am making a webhook to my script on my website in this form:</p>
  
  <pre><code>https://api.telegram.org/bot&lt;token&gt;/setWebhook?url=https://mywebsite.com/path/to/giveawaysbot.php
  </code></pre>
  
  <p>I get this text in response:</p>
  
  <pre><code>{"ok":true,"result":true,"description":"Webhook was set"}
  </code></pre>
  
  <p>So it must be working, but it actually doesn't.</p>
  
  <p>Here is my script code:</p>
  
  <pre><code>&lt;?php 
  
  ini_set('error_reporting', E_ALL);
  
  $botToken = "&lt;token&gt;";
  $website = "https://api.telegram.org/bot".$botToken;
  
  $update = file_get_contents('php://input');
  $update = json_decode($update);
  
  print_r($update); // this is made to check if i get any data or not
  
  $chatId = $update["message"]["chat"]["id"];
  $message = $update["message"]["text"];
  
  
  switch ($message) {
      case "/test":
          sendMessage($chatId,"test complete");
          break;
      case "/hi":
          sendMessage($chatId,"hey there");
          break;
      default:
          sendMessage($chatId,"nono i dont understand you");
  }
  
  
  function sendMessage ($chatId, $message) {
      $url = $GLOBALS[website]."/sendMessage?chat_id=".$chatId."&amp;text=".urlencode($message);
      file_get_contents($url);
  }
  
  ?&gt;
  </code></pre>
  
  <p>I don't actually receive any data to $update. So webhook is not working. Why?</p>