09-14-2015 17:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-14-2015 17:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Exception: Request failed for https://api.fitbit.com/1/user/-/activities/heart/date/2015-09-07/1d/1sec/time/00:00/23:59.json returned code 401. Truncated server response: {"errors":[{"errorType":"request","fieldName":"n/a","message":"API client is not authorized to access the resource requested."}]} (use muteHttpExceptions option to examine full response)
I am using the script from https://github.com/simonbromberg/googlefitbit and modified to get heart rate data according to the instruction. The code seems to be using Auth 2.0 and I am setting the scope for heartrate. Any idea what I might be doing wrong?
Thanks in adv.
Answered! Go to the Best Answer.

- Labels:
-
OAuth 1.0a
-
OAuth 2.0
-
Subscriptions API
Accepted Solutions
09-15-2015 12:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



09-15-2015 12:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
From the OAuth 2.0 access token you sent me, I confirmed that the access token did not contain permission for heart rate. You need to request the 'heartrate' scope in the authorization flow. See https://dev.fitbit.com/docs/oauth2/#scope

09-15-2015 17:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-15-2015 17:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@JeremiahFitbit wrote:From the OAuth 2.0 access token you sent me, I confirmed that the access token did not contain permission for heart rate. You need to request the 'heartrate' scope in the authorization flow. See https://dev.fitbit.com/docs/oauth2/#scope
Thanks for the help. It turned out that I didn't reset/reauthorize after changing the scope etc for the heart rate data.

09-14-2015 17:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



09-14-2015 17:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Sounds like you're using OAuth 1.0a. Maybe you should open an issue with that project.

09-15-2015 11:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-15-2015 11:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@JeremiahFitbit wrote:Sounds like you're using OAuth 1.0a. Maybe you should open an issue with that project.
Any particular reason you say that? I'm using Google's OAuth2 library (version 17). And from what I can glean from the code, it is making OAuth2.createService() calls to get Fitbit service.

09-15-2015 11:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



09-15-2015 11:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Private message me your OAuth 2 access token and I can tell you if it has the heart rate scope.

09-15-2015 12:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



09-15-2015 12:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
From the OAuth 2.0 access token you sent me, I confirmed that the access token did not contain permission for heart rate. You need to request the 'heartrate' scope in the authorization flow. See https://dev.fitbit.com/docs/oauth2/#scope

09-15-2015 17:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-15-2015 17:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@JeremiahFitbit wrote:From the OAuth 2.0 access token you sent me, I confirmed that the access token did not contain permission for heart rate. You need to request the 'heartrate' scope in the authorization flow. See https://dev.fitbit.com/docs/oauth2/#scope
Thanks for the help. It turned out that I didn't reset/reauthorize after changing the scope etc for the heart rate data.

01-13-2016 21:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-13-2016 21:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
how do I connect OAuth 2.0 ? how to access?

01-13-2016 21:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-13-2016 21:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'd like to get hearrate date from the fitbit
but problem is I can not authorize to get permission from fitbit.
How do I use OAuth2.0 ?
if possible please let me know about it. have a great day and Thanks and Best wishes
-Woong-

