简体   繁体   English

是否可以使用 Google Fit REST API 在同一网络应用程序中聚合来自多个用户的健身数据?

[英]Is it possible to aggregate fitness data from multiple users in the same web app using the Google Fit REST API?

I am currently working on a web application which is supposed to track multiple users and monitor their health parameters (pulse, number of steps, location etc).我目前正在开发一个 Web 应用程序,该应用程序应该跟踪多个用户并监控他们的健康参数(脉冲、步数、位置等)。 What I've currently thought about is having an administration interface which aggregates all data sent by the registered users.我目前想到的是有一个管理界面,可以汇总注册用户发送的所有数据。 I want to use the Google Fit REST API.我想使用 Google Fit REST API。

Is it possible to fetch the workout data of all registered/active users in the same screen, being authenticated only with the admin account?是否可以在同一屏幕中获取所有注册/活动用户的锻炼数据,仅通过管理员帐户进行身份验证? Does Google provide such feature?谷歌提供这样的功能吗? I know there is something similar for the Gmail API.我知道 Gmail API 有类似的东西。 I am looking for some kind of live tracking solution, but using the specified API.我正在寻找某种实时跟踪解决方案,但使用指定的 API。

I've already read the API documentation but I didn't find such thing yet.我已经阅读了 API 文档,但我还没有找到这样的东西。

No. You have to make requests authenticated as each of the individual users.不可以。您必须将请求作为每个单独的用户进行身份验证。

If you look in the documentation , the userId is documented thus:如果您查看文档,则会记录userId

Aggregate data for the person identified.已识别人员的汇总数据。 Use me to indicate the authenticated user.使用me来指示经过身份验证的用户。 Only me is supported at this time.目前只支持me

Requesting another user's data is not a supported feature.不支持请求其他用户的数据。

With that said, if a user grants you an OAuth token to access their fitness data, there is no reason that you can't get multiple users' data with multiple requests.话虽如此,如果用户授予您 OAuth 令牌以访问他们的健身数据,则您没有理由无法通过多个请求获取多个用户的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM