Search code examples
google-fitgoogle-fit-sdk

Reading other user's Google Fit data via REST API


We have a user who gave consent for our Cloud Project to read their Fit data through the Android app. We now want user's coach to access their Fit data through a web UI associated with our Cloud Project. Is this possible, and if so, what is the right way to do it?

Can cross-client identity be used? https://developers.google.com/identity/protocols/CrossClientAuth

I was trying to replace "me" with "[email protected]" in the REST endpoint but it doesn't work: https://www.googleapis.com/fitness/v1/users/me/... -> https://www.googleapis.com/fitness/v1/users/[email protected]/...

Thanks!


Solution

  • There is a mechanism for Android apps to obtain offline access for web back-ends highlighted in the CrossClientAuth guide from your question. With offline access, you can theoretically serve or store that data in any way that the user has consented to. Any access controls of that data to another person is something that you'd have to handle on your own.