Open choce001 opened 6 years ago
I'm running into this same issue.
Have you requested intraday data access from Fitbit?
Although if you're only using your own personal account that may not matter.
According to fitbit, as a personal app, we don't need to. https://community.fitbit.com/t5/Web-API-Development/Intraday-data-now-immediately-available-to-personal-apps/td-p/1014524
Have you tried the other intraday script?
I believe I tried them both, I will retry both of them now just to make sure.
Tried again quickly at work, screwed something up where I got 'OAuth2 is not defined'
I'll try again later this afternoon. Gotta prep for a meeting...
Also, are you sure there's data during the time period you're testing?
Yes. I've pulled data with another app.
I'm running into just the same problem! I'll break down some of the troubleshooting I've done so far on intraday_all.gs:
Line 294: var row = o[intradaysfield]["dataset"]; The variable o
refers to a .json dictionary which is derived from the result of the fetch on line 280, and the key intradaysfield
is set up as the string "activities-heart-intraday".
The fetch on line 280 is returning a result with only one top-level key, "activities-heart". That looks like the reason for that undefined error; there's no "activities-heart-intraday" key to access.
I'm guessing that this means the account is not delivering intraday data for some reason. It's a bit puzzling, since I'm set up as a personal app and it's supposed to grant access to intraday data immediately. I'm going to ask FitBit support about this, but do you all have any thoughts on this?
Have you tried intraday or just intraday_all?
I've tried both, and now that I think on it again, intraday has both "activities-heart" and "activities-heart-intraday" keys in its fetch, and works fine on the same account, so it must not be the permissions.
The fetch commands that retrieve these different results differ only in their URL strings:
"https://api.fitbit.com/1/user/-/activities/heart/date/" + dateString + "/1d/1min.json"
in intraday_all, which fails
versus
"https://api.fitbit.com/1/user/-/" + currentActivity + "/date/" + dateString+ "/" + dateString + ".json"
in intraday, which succeeds.
I tried simply switching out the string from intraday for the one in intraday_all - wish it were that simple, but the error persists!
I'll be glad to test anything, just let me know what I can do to help. I work in IT so I have access to a code editor all day long at work. 👍
Hello, I tried intraday and interday and they worked very weel but whenI run the intraday_all I got this message "TypeError: Unable to read dataset property from undefined" any idea ? Thanks by advance