我使用Google API Client for PHP获取google plus个人资料信息。这是我的代码:
$this->client = $client;
$this->client->setApplicationName(...);
$this->client->setClientId(config(...);
$this->client->setClientSecret(...));
$this->client->setScopes(...);
.......
$this->google = new \Google_Service_PlusDomains($this->client);
.......
$me = $this->google->people->get('me');
我的范围是:
https://www.googleapis.com/auth/plus.me
但是我得到了这样的错误:
Google_Service_Exception in REST.php line 110:
Error calling GET https://www.googleapis.com/plusDomains/v1/people/me: (403) Forbidden