通过phonenumber使用gdata-contacts获取联系人

时间:2015-08-17 13:39:19

标签: java gdata google-contacts

我正在尝试使用Contacts查询参数引用。见https://developers.google.com/google-apps/contacts/v3/reference#contacts-query-parameters-reference

我正在构建这样的查询:

URL feedUrl = new URL("https://www.google.com/m8/feeds/contacts/default/full");

Query query = new Query(feedUrl);

query.setMaxResults(1111);

query.setStringCustomParameter("phoneNumber", "123456789");

但Google API正在返回所有联系人,而我只想要拥有123456789号码的联系人。

是否可以通过电话号码获得谷歌联系人?

感谢

1 个答案:

答案 0 :(得分:1)

尝试将查询更改为https://www.google.com/m8/feeds/contacts/default/full?q=" 6785555455" 。我在oauth playground尝试了此操作,并且能够检索到匹配电话号码为6785555455的联系人。以下是回复:

<gd:name>
  <gd:fullName>Hello</gd:fullName>
  <gd:givenName>Hi</gd:givenName>
</gd:name>
<gd:phoneNumber rel="http://schemas.google.com/g/2005#mobile"  uri="tel:+91-1234-222-321">(678)-555-5455</gd:phoneNumber>
<gContact:groupMembershipInfo deleted="false"    href="http://www.google.com/m8/feeds/groups/guntupalliswathi%40gmail.com/b  ase/6"/>
</entry>
</feed>

请查看此link以供参考。

相关问题