04-15-2015 15:36
04-15-2015 15:36
I have been using a Google Apps script in a Google Spreadsheet to download minute by minute data. Today I tried to download data for my account and I got "We're sorry, a server error occurred. Please wait a bit and try again" at the top of the spreadsheet. Did something change in the API that might be causing this? It might be something with Google, have no idea how to debug it.
I have another spreadsheet that doesn't do the intraday stuff that's working fine.
This script was based off of things I found online
Here it is https://jsfiddle.net/j72qbe08/
08-01-2015 19:04 - edited 08-01-2015 19:05
08-01-2015 19:04 - edited 08-01-2015 19:05
Oh right, forgot abou tthe scope of the service. Good catch. Adding your comment to the Github repo's readme.
12-01-2015 17:30
12-01-2015 17:30
Hello! Could I ask what you mean by "listing inputing them thorugh "Setup"?
12-16-2015 18:22 - edited 12-16-2015 18:24
12-16-2015 18:22 - edited 12-16-2015 18:24
For those that were getting the "dataset" error I did the following:
- Go to dev.fitbit.com
- Open your App
- Click Edit Applicatioin Settings
- Make sure the OAuth 2.0 Applicatioin Type is Personal
I only realized this because when Fitbit emailed me and said Access to the Parner API no longer needed to request access to the partner API. In the email they were clear that the above OAuth 2.0 must be clicked Personal and I believe the default is Server (at least that was chosen in my case and I believe gave the dataset error).
02-10-2016 17:29
02-10-2016 17:29
Hello All,
Has anyone been able to get their heart rate data (intraday) into Google Sheets??
If so, could you please post the script. It would be greatly appreciated.
Thanks!!
Jim
02-10-2016 18:11
02-10-2016 18:11
Based on discussion in this forum I added a version of the script to pull heart rate data. Been a while since I tested it but check it out here:https://github.com/simonbromberg/googlefitbit
02-17-2016 07:02
02-17-2016 07:02
Has anyone had any success with downloading intraday heart rate data?
I have tried a Google Sheets Script editor discused here: github.com/simonbromberg/googlefitbit. I get ReferenceError: "OAuth2" is not defined.
I have tried a R Fitbit Scraper program discussed here: blog.corynissen.com/2015/01/r-package-to-download-fitbit-data.html. I have tried different variations but no success.
If anyone has been able to get their heart rate data downloaded lately, please let me know (if you could provide the script/code it would be greatly appreciated!!!!).
Thanks,
Jim
02-17-2016 07:52
02-17-2016 07:59 - edited 02-17-2016 08:00
02-17-2016 07:59 - edited 02-17-2016 08:00
Possibly missed a step in the instructions.
Also, note: those deprecated warnings are unrelated and don't affect the functioning of the algorithm.
02-22-2016 08:41
02-22-2016 08:41
Yes you must have missed a step because it works for me. I have successfully embedded a version of the script into my google sheet and wow, when it run it I can only run it for a single day as I get per 5-20 second (depending how often it reads) thousands per 24 hrs. So below, as you can see this is right as I awoke and jumped up out of bed yesterday and my HR jumps from 50s sleeping up to 100+ awake. I export it to comma separated so I can easily graph in Excel:
2/21/2016 6:33:00,54
2/21/2016 6:33:05,57
2/21/2016 6:33:20,57
2/21/2016 6:33:25,58
2/21/2016 6:33:30,59
2/21/2016 6:33:35,60
2/21/2016 6:33:45,61
2/21/2016 6:33:55,62
2/21/2016 6:34:00,65
2/21/2016 6:34:05,68
2/21/2016 6:34:10,70
2/21/2016 6:34:15,68
2/21/2016 6:34:20,71
2/21/2016 6:34:25,72
2/21/2016 6:34:35,75
2/21/2016 6:34:50,76
2/21/2016 6:35:05,90
2/21/2016 6:35:10,89
2/21/2016 6:35:15,91
2/21/2016 6:35:20,103
2/21/2016 6:35:25,104
2/21/2016 6:35:30,105
So, this definitely is a PITA but does work if set up properly.
Collin
02-22-2016 09:29
02-22-2016 09:29
Took it one step further finally got it exported to Excel and graphed properly! Totally going to re-dev this entire darn process start to finish into a single executable Powershell app as this PITA is absurd and folks shouldn't have to go through all this to get their HR data. Since I already wrote an oath2 framework for Twitter (#pstwitter) in Powershell - this shouldn't be too bad. Will update back here when I get to it!
https://twitter.com/collinchaffin/status/701819739094573058
02-23-2016 16:07
02-23-2016 16:07
So does any dev know whether Fitbit is simply not allowing grant type of client_credentials for the oAuth2 call to get the access token?
I'm getting the much longer access token successfully with 3600 expire returned, but when used in subsequent calls for data throws the 400 bad request error.
02-24-2016 05:08
02-24-2016 05:08
I have gotten it to work now, I missed the step to add the Google Auth2 piece.
Works perfectly!!
Thanks sshi.
02-27-2016 00:55
02-27-2016 00:55
It's working with a 30 day token no less! I have it down to a single param - what day you want and it exports every second of HR data to file. Updating to try to automate directly to Excel with charts. Stay tuned!
https://twitter.com/collinchaffin/status/703502752106881025
02-29-2016 22:03 - edited 02-29-2016 22:04
02-29-2016 22:03 - edited 02-29-2016 22:04
I'm at about 90%. Just polishing and will then add more to framework as I did with my PSTwitter framework. So, in my testing I can loop through day after day and pull each day with a single command to get all of this in a full xls Excel file. It even automatically creates the chart as shown!
https://twitter.com/collinchaffin/status/704538604668899328
03-04-2016 21:35
03-04-2016 21:35
03-12-2016 08:13
03-12-2016 08:13
Having the same problem you had with the OAuth2 error, how exactly did you fix it?
03-12-2016 08:27
03-12-2016 08:27
Anyone Else getting this error when you click download data "TypeError: Cannot call method "getContentText" of undefined."
03-12-2016 09:30
03-12-2016 09:30
I have not run the spreadsheet code lately but all my separate new Powershell cmdlet oAuth2 code I have written is still working fine and unlike this spreadsheet solution, I pull one authorization per 30 days storing the token. I've actually been utilizing my personal stored 30 day oauth token for weeks now as I wrap up going from my wireframe code to final code and it all has been working perfectly.
My cmdlet should be released soon and I am also working on a full GUI version of it to allow a calendar selection and I think I may even add a full 30 day capability of any contiguous 30 days to loop over each 24hr query, chart that day, then move on until you would have a directory containing 30 individual xlsx daily spreadsheets. Additional visualizations may come in phase 2. Getting the data is super fast but generating the xls chart is darn slow and that's 100% simply waiting for excel to generate it. Given how many lines of per second data it is charting it does not surprise me, but it slows it down enough that I still may go back in Phase 2 and add some collection-only options.
03-13-2016 12:05 - edited 03-13-2016 12:07
03-13-2016 12:05 - edited 03-13-2016 12:07
I am pleased to announce that my Windows Powershell based module is now available that retrieves daily per-second heartrate data and automatically produces a fully formatted daily Excel report with additional minimum/maximum/average and detailed chart visualization!
Read more here and I welcome your feedback and support and please remember to follow me on Twitter for updates!
https://twitter.com/collinchaffin/status/709090629599436800
03-13-2016 13:46
03-13-2016 13:46