Stepan
Stepan

Reputation: 43

Google People API: Get contact by a specific group

I am migrating our code from Google Contacts API to Google People API as Google Contacts API will be deprecated soon, but I noticed new People APIs are simple to compare with the old Contacts API.

How I can find a contact for a specific group? f.e. getContactByGroupId

Upvotes: 1

Views: 423

Answers (1)

Iamblichus
Iamblichus

Reputation: 19339

Answer:

Assuming that you meant getContactGroupById instead of getContactByGroupId, you can retrieve a specific contact group in People API by calling:

Further info:

In this case, you have to provide the resourceName instead of the contact id. If you don't know how to get the former, consider taking a look at this answer.

If you are using Apps Script, you can enable the Advanced People Service and do something like this:

People.ContactGroups.get(resourceName);

Upvotes: 1

Related Questions