03-20-2016 08:59
03-20-2016 08:59
I wrote up my experience getting intraday time series heart rate data from the Fitbit API.
https://tomhummel.com/2016/03/19/fitbit-heart-rate/
Sorry if this is not the right venue for this.
03-23-2016 05:23 - edited 03-23-2016 05:39
03-23-2016 05:23 - edited 03-23-2016 05:39
Thanks Tom
I did use the -n. I went ahead and just put it all into the script now and posted it into Github. I create the ssl key on the fly now. I can create variables for the keys as well, which I'll do later.
If you put your bits/keys in that script and it works, then it's an environmental issue on my mac, OR my Fitbit app and it's keys are not valid.
I can make a video of my attempt as well. Showingin more detail in my steps. Let me know.
03-23-2016 07:07
03-23-2016 07:07
03-23-2016 16:07 - edited 03-23-2016 16:10
03-23-2016 16:07 - edited 03-23-2016 16:10
From the verbose output of the curl command, this is the error within the output.
< HTTP/1.1 400 Bad Request
HTTP/1.1 400 Bad Request
This is the error I get at the end of the command.
{"errors":[{"errorType":"invalid_request","message":"Missing 'grant_type' parameter value. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],"success":false}
03-23-2016 16:17
03-23-2016 16:17
03-23-2016 16:21 - edited 03-23-2016 16:22
03-23-2016 16:21 - edited 03-23-2016 16:22
I'm running the code on github. It is setup with one ? only, as you instructed.
If you pull down that script and run it with your bits, it's all good for you?
03-23-2016 16:57
03-23-2016 16:57
I went ahead and created a new Fitbit app, to see if the app, ID or secret were corrupt or something. I set the app to oAuth2.0-personal. Created my temp token via the browser using a local Callback URL that I read would work. http://127.0.0.1:8080. It worked and generated my temp token.
I created the personal 64bit key out of the new ID and secret and hard coded it into the curl command. Updated the callback URL in the curl command.
Got the same **ahem** error.
03-23-2016 23:02
03-23-2016 23:02
I made a couple of changes. Hopefully this fixes your problem. https://github.com/roshepard/fitbit/pull/1
03-24-2016 06:31
03-24-2016 06:31
THAT WORKED! I just finished stepping through the full process and confirmed the new method works with the refresh token step. ALL GOOD!!!
I'll be putting this into a complete script now, THANKS TOTALLY TO YOU TOM, and will post it when it's working. The goal is to have a single script that will be able to loop through on a cron basis and pull the data down. I'll be playing for the rest of the morning now.
YOU ROCK TOM!
03-24-2016 17:52
03-24-2016 17:52
Yay! Glad to hear it. I'm debating whether I need to update my post. The `curl` commands work as listed when they aren't embedded in a shell script.
03-25-2016 09:11
03-25-2016 09:11
03-25-2016 09:51
03-25-2016 09:51
I'd look here re: scopes. https://dev.fitbit.com/docs/oauth2/#scope
03-25-2016 10:48
03-25-2016 10:48