Search code examples
androidgoogle-fitfitbitgoogle-fit-sdk

Begining with Google Fit API... Could I access to manage data from several users?


I have tried to search this in the website, but I have not got found it. I am new with google fit API, and I have a question:

  • I am going to develop a web platform to manage activity levels of several users, and I want to get these data from Google Fit. Can I do it? (or because of OAuth2 protocol and authentication tokens it is not possible?). I have issues trying to understand OAuth2 mechanism and I do not know if I can access the information knowing the token of each user (or it changes over time ¿?).

  • Similarly, using Fitbit API, do you know if it is possible or it works in the same way? (I know you need to use oAuth2 protocol, but in url for GET - for example - you can include the ID of a specific user).

To sum up, I do not know if these scenarios are possible:

Web Platform

web master ------GET-----> activity log of user 1 / activity log of user 2 / ...

I appreciate any information about that.


Solution

  • Yes there is no reason why you can not do this. Each user will have to go though the OAuth2 flow and you will then need to record the tokens for each user and just use the appropriate one in the future when accessing there data. Clearly you need to be clear with the user as to how your going to use the data, especially in relation to sharing it. You need to check the specific FIT terms and conditions to be sure your not looking to do anything that is explicitly excluded. You need to be aware that the user may revoke your access at any time so you need to be able to handle this.