使用Google API Client Library for PHP检索成员的所有组

使用Google API Client Library for PHP检索成员的所有组,php,google-api,Php,Google Api,我正在使用Google API Client Library for PHP,但我没有看到检索成员所有组的函数,但它存在于目录API中: 拿到钥匙 它丢了吗 有人知道如何使用PHP库实现这一点吗?您将使用groups.list()方法,这与您在Google Apps帐户中列出所有组时使用的方法相同。唯一的区别是指定userKey属性,将结果范围缩小到给定用户所属的组: $optParams = array( 'customer' => 'my_customer', 'userKey

我正在使用Google API Client Library for PHP,但我没有看到检索成员所有组的函数,但它存在于目录API中: 拿到钥匙

它丢了吗


有人知道如何使用PHP库实现这一点吗?

您将使用groups.list()方法,这与您在Google Apps帐户中列出所有组时使用的方法相同。唯一的区别是指定userKey属性,将结果范围缩小到给定用户所属的组:

$optParams = array(
  'customer' => 'my_customer',
  'userKey' => 'john@example.com'
);
$results = $service->groups->listGroups($optParams);