title: Cannot refresh token from google api OAuth2
body: <p>Here is my php script <code>RefreshToken.php</code></p>
  
  <pre><code>&lt;?php
  $url = 'https://accounts.google.com/o/oauth2/token';
  $post_data = array(
                      'code'          =&gt;   'xxxxxxxx',
                      'client_id'     =&gt;   'xxxxxxxxxxx',
                      'client_secret' =&gt;   'xxxxxxxxxxxxx',
                      'redirect_uri'  =&gt;   'http://localhost/googleapi/AuthenticationCode.php',
                      'grant_type'    =&gt;   'authorization_code',
                      );
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
  $result = curl_exec($ch);
  $token = json_decode($result);
  
  echo $token-&gt;refresh_token . "\n";
  ?&gt;
  </code></pre>
  
  <p><strong>Run PHP CLI</strong></p>
  
  <p>php -q RefreshToken.php </p>
  
  <p>PHP Notice:  Undefined property: stdClass::$refresh_token in /var/www/googleapi/RefreshToken.php on line 20</p>