从Google Fit API获取当前登录的用户信息(电子邮件或用户ID) [英] Get current logged in user info (email or userid) from google fit API

查看:229
本文介绍了从Google Fit API获取当前登录的用户信息(电子邮件或用户ID)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在集成Google Fit API来跟踪健身活动,我需要显示已登录的用户电子邮件,但无法从Google Fit中获取电子邮件或用户ID之类的用户信息.

I am integrating google fit APIs for tracking fitness activities and I need to display logged in user email, but I am not able to fetch user info like email or userid from google fit.

我找到了 https://developers.google. com/fit/rest/v1/reference/users/dataSources/get ,但我需要在无法找到的请求参数中添加userId和dataSourceId.

I have found https://developers.google.com/fit/rest/v1/reference/users/dataSources/get but I need to add userId and dataSourceId in request parameters which I am unable to find.

推荐答案

您在看错地方.

您要查找的数据位于: People API v1 .

The data you are looking for is under: People API v1.

为oAuth使用以下范围:

Use the following scopes for oAuth:

https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email

以下URL提取数据: https://people.googleapis.com/v1/people/me

Following url to fetch data: https://people.googleapis.com/v1/people/me

使用 access_token 进行呼叫应该对您有益.享受:)

A get call with access_token should be good for you. Enjoy :)

这篇关于从Google Fit API获取当前登录的用户信息(电子邮件或用户ID)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆