Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Contacts API vs People API

I'm having a problem with the 2 APIs above. Given the next scenario: I have 2 different google accounts. One that doesn't use Google+ and a second account that uses Google+

When using Contacts API on the first account that doesn't use Google+ I can see all my contacts:

GET /m8/feeds/contacts/<email>/full

Same for the second account that uses Google+.

When I'm using People API for the first account that doesn't use Google+, I'm getting an empty response (actually I'm getting just the next sync token:

GET https://people.googleapis.com/v1/people/me/connections

With the next scope:

https://www.googleapis.com/auth/contacts

Returns:

{
  "nextSyncToken": "CMe6...."
}

The same call for the second account (with Google+) works like a charm

The only difference between the 2 accounts is Google+, is it possible that People API only works for accounts with Google+? Or is it something else that I'm missing

like image 404
shachar Avatar asked Apr 03 '16 14:04

shachar


People also ask

What is Google's People API?

The People API lets you: Read and manage the authenticated user's Contacts. Read and copy the authenticated user's "Other contacts" Read profile information for authenticated users and their contacts.

Does Google contacts have API?

Stay organized with collections Save and categorize content based on your preferences. The Contacts API was turned down on January 19, 2022. Use this guide to learn about changes to fields, endpoints, and authorization scopes as you migrate to the People API.

Is Google People API free?

All use of Legacy People API is free of charge. Was this helpful?

How do I migrate to People API?

Google is deprecating the older Google Contacts API - it will be replaced by Google People API. In order to migrate to newer Google People API, you will need to re-authorize all your Google sources that were added before June 15th, 2021.


2 Answers

The People API is the newer version.

From Google APIs related to People API page:

The Google Contacts API will be deprecated in the future. The People API is the recommended replacement for apps that read contact data.

It is also important to note that the People API does in fact allow the developer to use "other contacts" just like Contacts API did. In addition, when migrating you should not have to re-ask for user consent to the following:

  • https://www.google.com/m8/feeds
  • https://www.googleapis.com/auth/contacts
  • https://www.googleapis.com/auth/contacts.readonly

Please see these links for further reading:

https://developers.google.com/people/related-apis (Contacts API vs People API) https://developers.google.com/people (Intro to People API)

I basically just copy/pasted most of this stuff but hopefully, some people find this helpful as I too was curious to find these answers :)

like image 78
Josh Lear Avatar answered Nov 10 '22 21:11

Josh Lear


I found the difference between the 2 APIs and it has nothing to do with the fact that one of the accounts is connected to Google+ or not

People API will only fetch the contacts that are under the account "My contacts" contacts, while Contacts API will also fetch the other contacts lists ("Other contacts", "Most contacts", ...)

like image 25
shachar Avatar answered Nov 10 '22 22:11

shachar