title: Google Api get users Email Address
body: <p>I am using the Google Api PHP client to Log the user in. I want to get the Users Email address. I have the following code.</p>
  
  <p>Scope:</p>
  
  <pre><code>$client-&gt;setScopes('https://www.googleapis.com/auth/userinfo.profile');
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>$request = new apiHttpRequest("https://www.googleapis.com/oauth2/v2/userinfo?alt=json");
  $userinfo = $client-&gt;getIo()-&gt;authenticatedRequest($request);
  
  $response = $userinfo-&gt;getResponseBody();
  print "&lt;pre&gt;" . print_r(json_decode($response, true), true) . "&lt;/pre&gt;";
  </code></pre>
  
  <p>This give me only the following details</p>
  
  <blockquote>
  <pre><code>Array
  (
      [id] =&gt; 110084312800396764
      [name] =&gt; Harsha M V
      [given_name] =&gt; Harsha M
      [family_name] =&gt; V
      [picture] =&gt; https://lh6.googleusercontent.com/-Xusc8lwgLIQ/AAAAAAAAAAI/AAAAAAAAAAA/sOthy23uJGk/photo.jpg
      [locale] =&gt; en
  )
  </code></pre>
  </blockquote>