title: Trouble with implementing google push notifications for calendar
body: <p>I have the following code :</p>
  
  <pre><code>$url = sprintf("https://www.googleapis.com/calendar/v3/calendars/calendarname/events/watch");
  /* setup the POST parameters */
  $fields = json_encode(array(
  'id'        =&gt; "012345423-2ab-cdef-01345232789ab",
  'type'      =&gt; "web_hook",
  'address'   =&gt; sprintf("https://mysite/response/")
  ));
  $access_token = 'access-token';
  /* setup POST headers */
  $headers[] = 'Content-Type: application/json';
  $headers[] = 'Authorization: Bearer ' . $access_token;
  
  /* send POST request */
  $channel = curl_init();
  curl_setopt($channel, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($channel, CURLOPT_URL, $url);
  curl_setopt($channel, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($channel, CURLOPT_POST, true);
  curl_setopt($channel, CURLOPT_POSTFIELDS, $fields);
  curl_setopt($channel, CURLOPT_CONNECTTIMEOUT, 2);
  curl_setopt($channel, CURLOPT_TIMEOUT, 3);
  $response = curl_exec($channel);
  curl_close($channel);
  
  print_r($response);
  </code></pre>
  
  <p>How ever i am getting the unauthorized url error. I have registered my site in the search console and it is showing it in the home page of the search console page. I am not able to identify the error here.</p>