Google Contact API Fetch Contacts related to a Contact Group

那年仲夏 提交于 2019-12-31 05:36:14

问题


I would like to know how to get all contacts related to a group. Let's say I have a contact group named "My Special Group" and the ID is xxxxxxx.I just want to retrieve contact under the "My Special Group" only.

I have already tried this Request URI and test it on oauth2 playground:

  1. https://www.google.com/m8/feeds/contacts/default/full/?group=xxxxxxx.
  2. https://www.google.com/m8/feeds/contacts/myemail%40gmail.com/full/?group=xxxxxxx.

And the result is:

<errors xmlns="http://schemas.google.com/g/2005">
 <error>
  <domain>GData</domain>
  <code>invalid</code>
  <internalReason>Supposed groupUri xxxxxxxxdoes not match template</internalReason>
 </error>
</errors>

What exactly the correct Request URI to retrieving contacts related to specific group?

Already walked around stackoverflow & the answer is exactly what I do above.Its failed.


回答1:


Okay fellas. I found the answer.Here it is.

The supposed Request URI to retrieve contacts related to a contact group is like this: https://www.google.com/m8/feeds/contacts/default/full?&group=http://www.google.com/m8/feeds/groups/yourmail%40gmail.com/base/xxxxxxx

where xxxxxx is the contact group id.

Before this I'm using this Request URI : https://www.google.com/m8/feeds/contacts/default/full?&group=xxxxxxx

where xxxxxx is the contact group id and the result is will be failed because I'm just put the group id instead of use full uri of contacts group .

So that's all.Hope its help.



来源:https://stackoverflow.com/questions/29585326/google-contact-api-fetch-contacts-related-to-a-contact-group

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!