In my old App Script, I use the following syntax:
var contacts = ContactsApp.getContactsByCustomField('tennis', 'Favorite Sport')
See documentation here.
I am now moving to People API. I can't seem to find the documentation for searching people using UserDefined values.
What I have found so far is search by name, not by user defined fields.
This does not search on my user defined fields:
var response = People.People.searchContacts({
query: "tennis",
readMask: "names,userDefined"
})
I'm afraid that there is no equivalent in the Advanced People Service for
ContactsApp.getContactsByCustomFieldFrom https://developers.google.com/people/api/rest/v1/people/searchContacts
Regarding "readMask", it is used to specified the fields to be included in the response.
Related