使用API​​获取谷歌目录联系人

时间:2013-06-13 14:06:17

标签: google-app-engine google-apps google-contacts google-api-client

我是Google Apps客户,希望使用Contact API搜索公司目录中的用户。

enter image description here

我可以使用例如:

来访问联系人
feed = gd_client.GetContacts()

但是,此返回的联系人只是我的联系人的一部分,而不是公司目录中的那些。

有没有人有这方面的经验或给我任何指示。

2 个答案:

答案 0 :(得分:0)

我认为您要寻找的是Domain Shared Contact API而不是Contact API。看看这个(https://developers.google.com/google-apps/domain-shared-contacts/

尝试针对域运行get请求,您应该能够检索目录联系人而不是个人联系人(https://developers.google.com/admin-sdk/domain-shared-contacts/#Retrieving

答案 1 :(得分:0)

尝试使用Query获取结果Feed。您可以指定最大结果以进入查询。这样,您的结果Feed将返回其他组中的更多联系人。

URL FeedURL = new URL("https://www.google.com/m8/feeds/contacts/default/full");
Query MyQuery = new Query(FeedURL);
MyQuery.setMaxResults(200);
ContactFeed ResultFeed = MyService.query(MyQuery, ContactFeed.class);