0
我能夠使用oAuth 2.0獲取access_token以獲得多個權限,如電子郵件,聯繫人,文檔等。我有access_token 我有使用以下代碼的聯繫人。Google API使用access_token獲取收件箱電子郵件?
$url = 'https://www.google.com/m8/feeds/contacts/default/full?max- results='.$max_results.'&oauth_token='.$access_token;
$response_contacts= curl_get_file_contents($url);
現在我想要使用此access_token獲取用戶電子郵件。 我用這個網址。但它給401 unauthorized Error
$url = 'https://mail.google.com/mail/feed/atom&oauth_token='.$access_token;
$response_emails= curl_get_file_contents($url);
請指導我如何使用可以拿到的access_token電子郵件。