我使用带API的Directory API来检索所有用户。 添加了电话号码的用户的响应如下所示:
Google_Service_Directory_User对象([collection_key:protected] => nonEditableAliases [addresses] => [agreeToTerms] => 1 [aliases] => [changePasswordAtNextLogin] => [creationTime] => 2016-11-29T14:21:30.000Z [customSchemas] => [customerId] => 1234 [deletionTime] => [电子邮件] =>数组([0] =>数组([地址] => test@companymail.com [primary] => 1)[1] =>数组([地址] => test@companymail.com))[etag] => "塔格" [externalIds] => [hashFunction] => [id] => 12344 [ims] => [includeInGlobalAddressList] => 1 [ipWhitelisted] => [isAdmin] => [isDelegatedAdmin] => 1 [isMailboxSetup] => 1 [种类] => admin #directory #user [lastLoginTime] => 2016-12-12T10:13:31.000Z [nameType:protected] => Google_Service_Directory_UserName [nameDataType:protected] => [nonEditableAliases] =>数组([0] => test@companymail.com.test-google-a.com [1] => test@companymail.com) [notes] => [orgUnitPath] => / [organizations] => [密码] => [电话] => [primaryEmail] => test@companymail.com [relations] => [suspended] => [suspensionReason] => [thumbnailPhotoEtag] => [thumbnailPhotoUrl] => [网站] => [internal_gapi_mappings:protected] => Array()[modelData:protected] =>数组([name] =>数组([givenName] => TestNAme [familyName] => TestNAme [fullName] => TestNAme TestNAme))[processed:protected] => Array())
电话号码是在5天前设定的(它在那里),但正如你可以看到"手机"数组是空的。
这就是我使用API的方式:
$directory_service = new Google_Service_Directory($client);
$params = array('domain' => $domain);
$results = $directory_service->users->listUsers($params);
$users = $results->getUsers();
我无法弄清楚出了什么问题。我需要启用任何设置吗? 如何获得用户'电话号码?
提前致谢。
答案 0 :(得分:1)
您可能已为域名联系人添加了电话号码,但在您自己的联系人数据中。这些将在“联系人”用户界面中显示“已合并”与域联系人详细信息,并且显示正确。但是,他们不会被其他人看到或存储在域数据中。
这样做是为了测试:
const elemExists = document.getElementById("load-angular");
if(elemExists) {
platformBrowserDynamic().bootstrapModule(AppModule);
}
,然后单击执行。 您应该会看到JSON中的手机数据已退回。完成后,您可以重新测试PHP代码。