0
votes

How do I retrieve individual email addresses that are members of a Google Contact Group?

Using the API, I seem to be able to only see which contacts are members of a group - contacts that might have multiple email addresses. However, the Gmail UI lets me create a group with individual email addresses.

To repro: 1) Open https://mail.google.com/mail/u/0/#contacts 2) Create a new contact called John Smith with two email addresses: [email protected] and [email protected] 3) Create a new contact group call "my group". Add (only) [email protected] to that group. 4) Now use the Google Contacts v3 API to fetch John Smith's record. It will look like this:

'gd$name': { 'gd$fullName': { '$t': 'John Smith' }, ... },
'gd$email': 
[ { address: '[email protected]',
   primary: 'true',
   rel: 'http://schemas.google.com/g/2005#other' },
 { address: '[email protected]',
   rel: 'http://schemas.google.com/g/2005#work' } ],
'gContact$groupMembershipInfo': 
[ { deleted: 'false',
   href: 'http://www.google.com/m8/feeds/groups/engtestuser%40mixmax.com/base/6' },
 { deleted: 'false',
   href: 'http://www.google.com/m8/feeds/groups/engtestuser%40mixmax.com/base/2a44002d89eb51e3' } ] }

How do I know that only [email protected] was added to "my group" (with id 2a44002d89eb51e3)? Where is the association between email addresses and groups stored?

1

1 Answers

0
votes

Entire contacts are added to groups, not just individual emails. You are finding the contact using one of their two email addresses, but the entire contact with both email addresses is added to the group. For this reason it's not possible to make that distinction.