ParticleRBK
ParticleRBK

Reputation: 11

How to get the contact details from DisplayName in Google's People API

This what I am trying to do -

  1. get the birthdays (events) from calender API. This has description of the contact - Person's birthday. I am extracting the name from here.
  2. Next using this DisplayName extracted, I want to fetch the detail of this person from my contacts.

I could not find a suitable method to get/filter based on the name.

Method: people.get can be used to get specific contacts, but it searches based on the resourceName (which is people/<person_id> assigned by the server)

So, is there a way to search/get the contact details of specific person by their Name.

Or Open to suggestions for other approaches. I am trying to make a birthday_wishes sender (if you haven't guessed already :-) )

Thank you in advance.

Upvotes: 1

Views: 563

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116908

People.get is only going to return the profile data for the currently authenticated user. Who has authorized your application with the profile scope.

Your not going to be able to search on random people and get their profile data with out them having first authorized your application.

You might be able to go though Connections.list which should return a list of all the contacts the user in question has and see if they have added the persons name.

Upvotes: 1

Related Questions