I want to get the list of friends in my circle (Google+). I am not getting that list; my code is as follows:
require_once('assets/google/Google_Client.php');
require_once('assets/google/contrib/Google_Oauth2Service.php');
require_once('assets/google/contrib/Google_PlusService.php');
$gClient = new Google_Client();
$gClient->setApplicationName('Login to Google');
$gClient->setClientId(GOOGLE_CLIENT_ID);
$gClient->setClientSecret(GOOGLE_CLIENT_SECRET);
$gClient->setRedirectUri($google_redirect_url);
$gClient->setDeveloperKey(GOOGLE_DEVELOPER_KEY);
$gClient->setScopes($scope);
$google_oauthV2 = new Google_Oauth2Service($gClient);
$google_plus = new Google_PlusService($gClient);
if (isset($_GET['code'])){
$gClient->authenticate($_GET['code']);
$_SESSION['token'] = $gClient->getAccessToken();
header('Location: ' .filter_var($google_redirect_url,FILTER_SANITIZE_URL));
return;
}
$user = $google_oauthV2->userinfo->get();
I am getting my details by calling the above function
$peoples = $google_plus->people->listPeople('me','visible');
When I use the above call to get the list of people, I get an insufficient permission (403). Can anyone help me to resolve this?
As per
https://stackoverflow.com/a/22303675/465974 or
https://stackoverflow.com/a/8136038/465974
it's not possible to get friends in specific circle
However as per
https://stackoverflow.com/a/17943068/465974 or
https://stackoverflow.com/a/16062671/465974
you can get list of friends