无法使用 - auth/user.phonenumbers.read 范围从用户的谷歌个人资料中读取电话号码

Vis*_*tel 5 google-api scopes google-oauth google-people-api

根据Google People API的文档,我正在使用配置文件范围 - https://www.googleapis.com/auth/user.phonenumbers.readPersonFields=phoneNumbers仅在其 Google 配置文件中读取经过身份验证的用户的电话号码(没有来自联系人列表)。我正在使用 API 密钥和 oAuth 访问令牌来授权请求​​。google people API 不会单独获取与上述范围的个人资料关联的电话号码。除了上述范围之外,还添加了整个联系人列表读取权限的范围,即www.googleapis.com/auth/contacts.readonly正确返回个人资料中的电话号码. 有没有办法从他/她的个人资料中获取用户的电话号码使用 user.phonenumbers.read 范围?

Vis*_*tel 7

我能弄清楚问题所在。对于“user.phonenumbers.read”范围,人员 API 的文档说明-“您的应用程序被授予读取其Google 个人资料中经过身份验证的用户电话号码的权限”。

但是“ Google 个人资料”表示Google Plus 个人资料,这他们的核心 Google 个人资料 -我的帐户完全不同。People API 仅从 Google Plus 个人资料中获取信息。

因此,即使用户在我的帐户中添加了他/她的联系方式,人员 API 也不会获取他们的电话号码,除非他们在他们的 Google Plus 个人资料中手动添加了电话号码。添加联系方式后,我可以使用“auth/user.phonenumbers.read”获取联系方式,而无需添加“auth/contacts.readonly”范围。