This question ask many time but i have some other issue .i have got access token successfully and got contact list access fully using this google.com/m8/feeds/contacts/default api. Now i want retrieve user info using same access token and use Index.php i use this code :This is google login page where any user login using google account :
Sign In with Google for retrieving Contacts
<a href="https://accounts.google.com/o/oauth2/auth?client_id=CLIENT_ID&
redirect_uri=callback.php&
**scope=https://www.google.com/m8/feeds/&response_type=code**">
<img src="images/sign1.png" alt="" id="signimg"/>
</a>
After user login with google account it is go to on callback.php below is code for callback.php. Now i will fetch contacts I got all contacts successfully using this access token
$url = 'google.com/m8/feeds/contacts/default/full?
max-results=' . $max_results . '&oauth_token=' . $accesstoken;
$xmlresponse = curl_file_get_contents($url);
Now i am want fetch userinfo
like email and name of user using this Access Token But i can not fetch any details using this access token.
$userDetails = file_get_contents('https://www.googleapis.com/oauth2/v1/userinfo?
access_token=' . $accesstoken);
$userData = json_decode($userDetails);
echo 'userData='.$userData;
I have check also google developer console for that there is permission or not . I have given permission for contact , gmail and google+ api. How i can got user email id using access token.