title: emails from gmail but response is gmail.readonly
body: <p>I am trying to get the emails from gmail using <code>https://www.googleapis.com/auth/gmail.readonly/?access_token='fdrt654vfdgfe6545</code>But in response I am getting <code>gmail.readonly</code>But the <code>System.HttpResponse[Status=OK, StatusCode=200]</code> is fine. Can any guide me is there anything I am missing out. </p>
  
  <p>This I how I requested got auth but in the response I received access token </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    (function() {
     var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
     po.src = 'https://apis.google.com/js/client:plusone.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
   })();
  &lt;/script&gt;
  
  
  
    &lt;script type="text/javascript"&gt;
        (function() {
             var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
             po.src = 'https://apis.google.com/js/client:plusone.js';
             var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
       })();
  
       var AuthStates = {google: null};
  
       function signinCallback(authResult) {
            if (authResult['status']['signed_in']) {                  
              // Update the app to reflect a signed in user
              // Hide the sign-in button now that the user is authorized, for example:
              document.getElementById('signinButton').setAttribute('style', 'display: none');
              //alert(authResult['code']);
              console.log('code state: ' + authResult['code']);
              //console.log('authResult : ' + authResult[]);
              AuthStates.google = authResult;
              console.log('authResult 1 : ' + authResult['status']['method']);
              console.log('auth Result : ' + authResult['id_token']);
              //{!access_token} = authResult['access_token'];
              //{!code} = authResult['code'];
              connection(authResult['access_token'], authResult['code']);
            } else {
              // Update the app to reflect a signed out user
              // Possible error values:
              //   "user_signed_out" - User is signed-out
              //   "access_denied" - User denied access to your app
              //   "immediate_failed" - Could not automatically log in the user
              console.log('Sign-in state: ' + authResult['error']);
            }
          }
  
    &lt;/script&gt;
  
  
    &lt;apex:outputPanel &gt;
        &lt;span id="signinButton"&gt;
            &lt;span
              class="g-signin"
              data-callback="signinCallback"
              data-clientid="clientid"
              data-cookiepolicy="single_host_origin"                
              data-scope="https://www.googleapis.com/auth/gmail.readonly"
              data-response_type="code"
              data-redirect_uri="http://test-on.ap1.visual.force.com/apex/Gmail_inbox"&gt;
            &lt;/span&gt;
      &lt;/span&gt;
      &lt;apex:form &gt;
  </code></pre>
  
  <p>So as i got my access token from my request I can go directly for getting all information related to the logedin user. As I am getting all the information regarding the user I am trying to get all the emails related to him. Is I am doing right or I am wrong any place. I am very new with api and web service trying to learn. please do help me put out. </p>