3

I am working with Google Contact API v3. The goal is to synchronize contacts between my DB and a Google Account. My problem is :

1) when I search contact by email address without a contact group, I get one good result

Here is the query :

https://www.google.com/m8/feeds/contacts/default/full?q=myemail%40hotmail.fr&max-results=1&v=3.0&access_token=XXXXXXXXX

2) when I do the same search within a contact group, I get all contacts list

Here is the query :

https://www.google.com/m8/feeds/contacts/default/full?q=myemail%40hotmail.fr&group=http://www.google.com/m8/feeds/groups/factorycrm%40gmail.com/base/64e5e3218c7572e4&max-results=1&v=3.0&access_token=XXXXXXXXXXX

This is a real problem because second query messes all contacts in Google account.

My question is : how to search a contact by its email address within a google contact group ?

Thanx

1 Answers1

1

I was also cracking my brains with this one. Seems that Google drops the q parameter when the group one is provided. To resolve this, I've started keeping the Google contact ID and queried it directly instead of via the Group. So basically you're stuck with fetching the contact directly, and then checking its group.
https://www.google.com/m8/feeds/contacts/default/full/{contact-id}

Tal
  • 7,827
  • 6
  • 38
  • 61
  • I'm experiencing the same problem. Seems so odd that "Google drops the q parameters when the group one is provided," since the documentation seems to indicate the opposite: "*group* Constrains the results to only the contacts belonging to the group specified." (https://developers.google.com/google-apps/contacts/v3/reference#contacts-query-parameters-reference) I think @Tal is right, but it's a bummer if this really is a "This feature doesn't work as documented." – pettys Oct 08 '15 at 14:05