Google Contacts API 与 People API [英] Google Contacts API vs People API

查看:24
本文介绍了Google Contacts API 与 People API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用上述 2 个 API 时遇到问题.鉴于下一个场景:我有 2 个不同的谷歌帐户.一个不使用 Google+ 的帐户和另一个使用 Google+ 的帐户

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+

在第一个不使用 Google+ 的帐户上使用 Contacts API 时,我可以看到我的所有联系人:

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

第二个使用 Google+ 的帐户也是如此.

Same for the second account that uses Google+.

当我为第一个不使用 Google+ 的帐户使用 People API 时,我得到一个空响应(实际上我只得到下一个同步令牌:

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

使用下一个范围:

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

返回:

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

对第二个帐户(使用 Google+)进行相同的调用就像一个魅力

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

这两个帐号的唯一区别是 Google+,People API 是否可能只适用于 Google+ 帐号?或者是我遗漏的其他东西

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

推荐答案

我发现了 2 个 API 之间的区别,这与其中一个帐户是否连接到 Google+ 的事实无关

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 只会获取帐户我的联系人" 联系人下的联系人,而 Contacts API 也会获取其他联系人列表(其他联系人"大多数联系人"、...)

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

这篇关于Google Contacts API 与 People API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆