0
votes

I am new at Google People API. I am able to fetch contacts through api, but I couldnt figure out how to create contacts. As api documantation says I need to use this code block;

Person contactToCreate = new Person();
List names = new ArrayList<>();
names.add(new Name().setGivenName("John").setFamilyName("Doe"));
contactToCreate.setNames(names);
Person createdContact = peopleService.people().createContact(contactToCreate).execute();

But createContact is giving "Cannot resolve method 'createContact(com.google.api.services.people.v1.model.Person)' " error. How can I solve this problem ? Or are there another ways to create Google Contact ?

1
It looks like the java client library link hasn't been updated. I'll take a look into this.Amos Yuen

1 Answers

1
votes

There was a bug with the automatic java client library code generation. The bug has been resolved and the latest version 125 has the contact endpoints. Follow the instructions at https://developers.google.com/people/v1/libraries to install the latest library.