0

我正在使用测试:

https://developers.google.com/+/api/latest/people/get

https://developers.google.com/apis-explorer/#p/plus/v1/plus.people.get

他们都没有返回用户的性别,即使它是公开可见的。

我也尝试过启用 OAuth 2.0,但仍然没有任何运气。

有任何想法吗?

4

2 回答 2

2

此信息可从/oauth2/v1/userinfo API获得。

您将需要包含 OAuth 2.0 范围:https://www.googleapis.com/auth/userinfo.profile.

可以从端点获取信息: https://www.googleapis.com/oauth2/v1/userinfo?access_token={accessToken}

官方文档: https ://developers.google.com/accounts/docs/OAuth2Login#userinfocall

API 资源管理器: https ://developers.google.com/apis-explorer/#p/oauth2/v2/oauth2.userinfo.get

于 2012-09-19T04:04:03.787 回答
1

如果你看看:https ://developers.google.com/apis-explorer/#p/plus/v1/plus.people.get?userId=114452557602978803926&_h=1&你会发现你可以使用 people.get () 检索已公开该信息的任何用户的性别。

于 2013-04-02T06:53:03.780 回答