Comments
Hi Robert,
Recently, I keep getting a time-based error every morning. The Error is: Access not granted or expired. I do go in a re-authorize, and then have it Get Metrics and it works. But then the same issue happens the next morning. How do I get it to do what it was doing before? I went back to your instructions, but I still had the issue today.
Robert, thank you for your work! I did everything according your explanation. When I try to get Metrics, I get red error message "Error: Access not granted or expired.Details". Did it several times but problem is stiil here. Thanx in advance.
regards, Alex
Nadezda - most likely it's an authorization problem. Follow the steps above to remove authorization and then re-authorize. If this doesn't clear it check the API explorer link to make sure you can see weight data that way.
Hi Robert,
I've find reason of my 403 error:
"datasource not found or not readable: derived:com.google.weight:com.google.android.gms:merge_weight".
Look's like I have not weight data, right?
Why it's could happend? I've import weight data in Google Fit app from other one (Picooc) and in GF app I can see weight data. The same sitation with steps and distance butI do not user GF for then.
So, I confuse with it. Could you help me, pls. How to fix it.
Thank you.
Quinn - I don't have a sleep tracker so it's going to be hard for me to try and figure that one out. If anyone else has managed this please chime in.
Hi Robert,
I wanted to thank you for providing this resource and the detailed steps on how to set this up.
I have found information on the "sleep" metrics on the google fit API in an attempt to add the functionality to read sleep data.
The problem I am running into is that Google fit treats Sleep data as a "session" instead of a "dataset" (steps, distance and weight all fit into this catagory)
Would you be able to provide any insight on how I could possibly read this information? The request URL contains start times and end times which is not present on the ".setscope" URL's that read steps, distance and weight.
It is possible to access this information through the getfitservice/request variable or will this need another function added?
Gary, I didn't touch the OAuth consent screen when I got this working. When I look for the project I'm using mine is set to External and everything works fine. For the project the only changes I made were to enable the Google Photos API and set the redirect URL to the script.google.com domain as described below. Given your error it might be that you don't have one of the items that the script is requesting - check the API explorer link near the end of the post to see if that helps. If not, then I'd suggest starting from scratch with a new sheet and a new API project and don't touch any settings relating to the consent screen as you work through setting it up.
Hey Gary,
All this GSuite stuff is stuff I never saw during my setup. I think you may have fallen down a rabbit hole at some point. Perhaps Robert has some insight?
Hey, three others things I've been seeing if would make a difference:
1) 'Secret Manager API' is not enabled. 'Stores, manages, and secures access to application secrets. $0.03/10,000 count'
Not sure I need this, no mention above.
2)'Identity and Organisation' Not sure if I need to complete this...
It seems I'll need a corporate domain and company details.
3)'Policy troubleshooter. Enter the following fields to check if the API call will grant the principal access to a resource.'
Policy troubleshooter' [Principle member e...]
Resource permission pairs'
'Resource: [e.g.] ...265113
Permission [e.g.] Example: "...etIamPolicy"
Thanks Agnes, Yes - I'm a rookie too!
The Google fitness API status is showing as enabled. However, the 'OAuth consent screen' status is still 'Verification status - Not published'.
The consent is set to 'external'. 'Internal' is only an option for Gsuite users, but it states that 'in this mode, your app is available to any user with a Google Account. External apps that request sensitive or restricted user data must first be verified by Google. This process may take 4â6 weeks. In addition, if you selected restricted scopes, you'll need to go through an independent security review, which can cost $15kâ$75k.'
I'm not clear if I've set it up incorrectly so that Google thinks I'm collecting sensitive personal data! Or if the consent page will be published soon.
Add Comment
All comments are moderated. Your email address is used to display a Gravatar and optionally for notification of new comments and to sign up for the newsletter.