【发布时间】:2014-08-19 19:55:46
【问题描述】:
我将 PHP google api 与 OAuth2 一起使用。
代币进程的所有进程 已成功完成。
我使用范围:
$a_scopes = array(
Google_Service_Oauth2::USERINFO_EMAIL,
Google_Service_Oauth2::PLUS_ME,
'https://mail.google.com/mail/feed/atom'
);
$this->client->setScopes($a_scopes);
我使用代码来检索电子邮件:
$plus = new Google_Service_Plus($this->client);
$person = $plus->people->get('me');
$user = $person->getEmails();
echo("<pre>");var_dump($user);die("</pre>");
结果:
array(1) {
[0]=>
object(Google_Service_Plus_PersonEmails)#29 (4) {
["type"]=>
string(7) "account"
["value"]=>
string(17) <My Email>
["modelData":protected]=>
array(0) {
}
["processed":protected]=>
array(0) {
}
}
}
【问题讨论】:
标签: php oauth-2.0 google-oauth google-api-php-client gmail-api