title: Calling google api url shortener via curl returns HTTP 403 status in php
body: <p>I have a problem calling Google <code>urlshortener</code>. I use <code>curl</code> function to make a call:</p>
  
  <pre><code>$url = base_url()."home/register?source=@".$userid;
  $longUrl = $url;
  $apiKey = 'xxxxxxxxapikeyxxxxxxx';
  $postData = array('longUrl' =&gt; $longUrl, 'key' =&gt; $apiKey);
  $jsonData = json_encode($postData);
  $curlObj = curl_init();
  curl_setopt($curlObj, CURLOPT_URL, 
  'https://www.googleapis.com/urlshortener/v1/url?key='.$apiKey);
  curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($curlObj, CURLOPT_HEADER, 0);
  curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content- 
  type:application/json'));
  curl_setopt($curlObj, CURLOPT_POST, 1);
  curl_setopt($curlObj, CURLOPT_POSTFIELDS, $jsonData);
  $response = curl_exec($curlObj);
  $json = json_decode($response);
  curl_close($curlObj);
  print_r($json);
  </code></pre>
  
  <p>So I'm getting the following response:</p>
  
  <pre><code>stdClass Object ( [error] =&gt; stdClass Object ( [errors] =&gt; Array ( [0] =&gt; 
  stdClass Object ( [domain] =&gt; global [reason] =&gt; forbidden [message] =&gt; 
  Forbidden ) ) [code] =&gt; 403 [message] =&gt; Forbidden ) )
  </code></pre>
  
  <p>Please help me.</p>