0
votes

I use the official google API framework for php,

these works for me:

$plus->people->get('444444444');
$params = array('maxResults' => 100);
$activities = $plus->activities->listActivities('444444444', 'public', $params);

but calling friends with:

$plus->people->listPeople('444444444', 'visible',array())

with the scope: https://www.googleapis.com/auth/plus.login

i am getting this error message:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "Forbidden"
   }
  ],
  "code": 403,
  "message": "Forbidden"
 }
    }
1

1 Answers

0
votes

Extract the access token from the token JSON you can retrieve from the library ($client->getAccessToken()), and make sure it has plus.login in the list of scopes in the tokeninfo: https://www.googleapis.com/oauth2/v1/tokeninfo?access_token= ?

Its also worth noting you can only make it for the user that has granted access - so you can u se "me" instead of the user ID (though the user ID will work fine).

Finally, make sure the user in question is not a Google Apps user where Google+ has been disabled. In that case, you will get a 403 error, as the user doesn't have circles to grant access to!