I’m currently working on accessing Google Fit data using its API. I have successfully set up the credentials with the Google OAuth2 API and have specified the scope as https://www.googleapis.com/auth/fitness.activity.read The connection is established, and when I send an HTTP request to https://www.googleapis.com/fitness/v1/users/me/dataSources, I receive a dataSource in response. However, when I try to make a request to https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate, I encounter an error. I’m trying to identify what I might be doing wrong in this case.
Thank you, Jon. That was it. Also as per this link. I should be getting the total daily steps with the code. I’m getting the result, but with empty arrays? Am I doing this wrong?
Hey Jon, I guess they are. But let me try adjusting the code and check. As per the google developer example it should give me a total amount of steps for the day.
The bit that caught my eye was the start and end times, Your example is using 2 dates from August 2015 so you would need to update that unless you are specifically looking for back then.
Hello Jon, I appreciate your replies. Indeed, the start and end times were the key issue. Therefore, I configured a function node to retrieve the current day as a Unix timestamp, as needed, and subsequently connected it with the HTTP request.
You might have been able to do it with an expression as well using Luxon to handle the formatting but that can be for a future iteration of the workflow once you are happy with it