Hi forum,
I got problem while trying to get activities from a certain community.
I registered google api console, and wrote a test problem like the following:
<?php
require_once "google-api-php-client/src/Google_Client.php";
require_once "google-api-php-client/src/contrib/Google_PlusService.php";
const KEY_FILE = '/path/to/my/privatekey/file/privatekey.p12'; // you can bet I didn't really use a file name like this
$client = new Google_Client();
$key = file_get_contents(KEY_FILE);
$client->setClientId(CLIENT_ID);
$client->setAssertionCredentials(new Google_AssertionCredentials(
SERVICE_ACCOUNT_NAME,
$key)
);
$plus = new Google_PlusService($client);
$optParams = array('maxResults' => 100);
$activities = $plus->activities->listActivities('COMMUNITY_ID', 'public', $optParams);
When running to the last line, php caught an exception which showed in my apache log:
[deleted]
This community is public.
I enabled "Google Admin SDK", "Google+ API", "Google+ Hangouts API", and "Prediction API" in the google api console settings.
Could anyone please tell me what else should I do to get the community activities list?
Thanks,
Franklin