Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
296 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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", ...)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...