I want to retrieve my contacts names, email address and phone numbers using the Google People API and I'm using their Try it! tool to test the API.
The names are being retrieved but not the emails addresses and phone numbers. I think I'm doing everything correctly. I'm properly authenticated with the proper scopes and selected fields.
Am I doing something wrong? Or maybe this is an issue on Google's side?
I have found a solution. According to the Google People API docs omitting this RequestMask
field will include all fields but that's not happening. In my case setting the RequestMask
field to person.names,person.emailAddresses,person.phoneNumbers
works.
You have to use people.connections.list to fetch the list of contacts, then loop over them and use people.get in order to fetch each individual contact. In my case I set pageSize to 50 and then I use people:batchGet (which supports up to 50 resource names at a time) to fetch the details for those 50 contacts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With