如何访问我的 Gmail 帐户中的信息,例如照片、tokenId、名字、姓氏和 Gmail id?
我搜索了很多,但没有正确的答案。
这个 api https://www.googleapis.com/plus/v1/people/me返回
{
"gender": "male",
"id": "234343028403284",
"displayName": "xxx",
"name": {
"familyName": "foo",
"givenName": "bar"
},
"url": "https://plus.google.com/34324234324324",
"image": {
"url": "https://lh3.googleusercontent.com/dlkfjdsfds/djfldsf"
}
...
}
在您的应用程序可以访问用户的 Google 帐户中的数据之前,应用程序必须请求用户的授权。
有关 oauth 的信息,请参阅https://developers.google.com/+/api/oauth。
尝试:https ://developers.google.com/oauthplayground/将帮助您了解 oauth 流程:
第 1 步:选择 Google+,Authorize apis
第2步:Exchange authorization code for tokens
第 3 步:输入https://www.googleapis.com/plus/v1/people/me Send the request