问题
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