使用 Groups PHP API 并尝试获取现有的组设置和成员。
感谢divideandconquer.se的帮助,我修改了我的代码:
function get_google_group($groupId) {
$group = false;
try {
echo '<br />Getting Google Group: ' . $groupId . '<br />';
$myClient = $this->getClient();
$myClient->addScope( 'https://www.googleapis.com/auth/apps.groups.settings');
$groupsettingsService = new Google_Service_Groupssettings($myClient);
$group = $groupsettingsService->groups->get($groupId);
echo 'SUCCESS: group=';
} catch (exception $e) {
echo '<br />*** EXCEPTION *** ' . $e->getMessage() . '<br />';
return false;
}
return $group;
}
我仍然遇到异常:在调用“get”方法时:
Getting Google Group: 04k668n33tdjvkw
*** EXCEPTION *** Error calling GET https://www.googleapis.com/groups/v1/groups/04k668n33tdjvkw: (403) GData insufficientPermissions Insufficient Permission