Method: people.get() does not return names

痞子三分冷 提交于 2020-08-10 20:24:37

问题


I have a question regarding API:

GET https://people.googleapis.com/v1/{resourceName=people/*}

When the resourceName = people/account_id and the personFields is 'names' the API returns names only when the account_id has a Google+ account associated with it. For the account_id without associate Google+ account, no names are returned.

My application scopes are:

  • https://www.googleapis.com/auth/userinfo.email
  • https://www.googleapis.com/auth/contacts
  • https://www.googleapis.com/auth/plus.login

Is this expected behaviour? Is it possible to get account name by account_id without Google+ account?

Thank you in advance.


回答1:


This is expected behavior. In general when getting data on other users, you only get their public data. Non G+ users don't have a public profile and so their name is not public unless they have explicitly set their name to be public.

See https://developers.google.com/people/#a_merged_view_of_people_information for more details on what data you should get.



来源:https://stackoverflow.com/questions/50766097/method-people-get-does-not-return-names

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!