Now we are trying to replace Contact API with People API and it seems very complicated.
First of all, there is no method to search in all contacts (Contact, Other contact, Domain contacts). So we need to search in three different places and merge results. Or I am missing something? Previously we used service.getFeed(query, ContactFeed.class);
The second problem is that search in Contact API works in a different way than in People API. Contact API returns all contacts that contain a provided query as a substring in fields. People API returns contacts only that contain a field that start with provided query.
Does anyone find a solution to these problems?
UPDATE1: In People API we need to search in three different places:
https://developers.google.com/people/api/rest/v1/otherContacts/search - to search among Other contacts list; https://developers.google.com/people/api/rest/v1/people/searchContacts - to search among Contact list; https://developers.google.com/people/api/rest/v1/people/searchDirectoryPeople - to search among user's Domain directory;
Here is an article describing differences: https://www.nylas.com/blog/google-people-api-vs-contacts-api-migration Section "Parse Contact Info"
UPDATE2: Here is the code for Contacts API, Java:
Query query = new Query(new URL("https://www.google.com/m8/feeds/contacts/default/full"));
query.setMaxResults(Integer.MAX_VALUE);
query.setFullTextQuery("du"); // query itself
contactsService.getFeed(query, ContactFeed.class).getEntries();
Query query = new Query(new URL("https://www.google.com/m8/feeds/contacts/default/full")); query.setMaxResults(Integer.MAX_VALUE); query.setFullTextQuery("du"); // query itself return contactsService.getFeed(query, ContactFeed.class).getEntries();
– Dmitriy