11-12-2016 11:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-12-2016 11:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello,
I'm trying to make a simple request on the API to get back heartrate scope.
I red API documentations and many subjects and the forum but i sill do not understand how to do it.
here where i am:
- Set in API an new app to be able to get the require information to get create an refresh a token
- With postman
- i set url request: get -> https://api.fitbit.com/1/user/-/profile.json
- In authorization : choose OAuth2 , Manually Get New Access Token ( left orange button -> get New Access oken) , and fill the required informations
- Token Name
- Auth URL
- Access Token URL
- Client ID
- Client secret
- Scope: heartrate
- Grand type: Authorization Code
- Then click to add tokenin the header
- In header:
- Content-type: application/x-www-form-urlencoded
- Authorization : bearer ...(automatically filled by the step 1.2.8)
When i send the request i received the following message
{"errors":[{"errorType":"insufficient_scope","message":"This application does not have permission to access profile data. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],"success":false}
i don't get it , i already gave this information in the step 2.2.6.
Any ideas?
Answered! Go to the Best Answer.

- Labels:
-
OAuth 2.0
-
Subscriptions API
Accepted Solutions
01-17-2017 08:10 - edited 01-17-2017 08:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-17-2017 08:10 - edited 01-17-2017 08:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@dsalerne You're using your client ID when you should be using your user ID.
https://api.fitbit.com/1/user/2287Q3/activities/heart/date/today/1d/1sec.json
2287Q3 - this is your client ID.
See my post on how to get your user ID and use that instead.
@AndrewFitbit wrote:
@dsalerne Your userId is not on that page, it's at the end of the URL when you click "View Profile" from your dashboard settings (you can also navigate there by clicking your profile image at: https://www.fitbit.com)

11-12-2016 12:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



11-12-2016 12:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@dsalerne The call you're making is to access profile data, not heart rate. You're only granting the heart rate scope, so you don't have permission to access anything else other than heart rate. This is why you get an "insufficient_scope" error when you make this call: https://api.fitbit.com/1/user/-/profile.json
The heart rate endpoints are listed in our API docs if you're trying to get heart rate data.

12-05-2016 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-05-2016 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello,
My computer crashed and i lost whole my postman config.
I set like before, now with the good adress to get.
I get the token with authorization page, i give the authorization but when i try to request with this
https://api.fitbit.com/1/user/[MYUSERID]/activities/heart/date/today/1d/1sec.json
i received this message:
{"errors":[{"errorType":"insufficient_permissions","message":"API client is not authorized by the resource owner to access the resource requested. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],"success":false}

12-06-2016 13:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



12-06-2016 13:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@dsalerne When you auth your app, you need to grant access to the heart rate scope to be able to access heart rate data.

12-07-2016 02:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-07-2016 02:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello,
It seems to me i do so.
After setting app in devfitbit account and do my first request to get token i have the authorization popup with the description my application wants to access data on Hearrate ( selected). I select "Accept" but still have the error.
Is there an other step?

12-07-2016 08:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



12-07-2016 08:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@dsalerne wrote:
https://api.fitbit.com/1/user/[MYUSERID]/activities/heart/date/today/1d/1sec.json
@dsalerne Are you substituting [MYUSERID] with "-" or with an actual user id? Because if you're inserting a user id of a user that did not auth your app, then that would be another reason why you would see the following error:
@dsalerne wrote:
{"errors":[{"errorType":"insufficient_permissions","message":"API client is not authorized by the resource owner to access the resource requested. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],"success":false}

12-08-2016 08:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-08-2016 08:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello,
I'm submitting with my userId.
The one i got from "application | Registered"

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

01-13-2017 01:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello,
i still have the issue.
Any idea?

01-13-2017 09:06
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-13-2017 09:06
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
dsalerne wrote:I'm submitting with my userId.
The one i got from "application | Registered"
@dsalerne Your userId is not on that page, it's at the end of the URL when you click "View Profile" from your dashboard settings (you can also navigate there by clicking your profile image at: https://www.fitbit.com)
Can you show me the actual request you're trying to make, including what you're using for userId?

01-16-2017 00:19 - edited 01-16-2017 00:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-16-2017 00:19 - edited 01-16-2017 00:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello,
I'm trying to request with this:
https://api.fitbit.com/1/user/2287Q3/activities/heart/date/today/1d/1sec.json
to be able the same data as your example
https://api.fitbit.com/1/user/-/activities/heart/date/today/1d/1sec.json{"activities-heart":[{"dateTime":"2017-01-16","value":{"customHeartRateZones":[],"heartRateZones":[{"max":93,"min":30,"name":"Out of Range"},{"max":130,"min":93,"name":"Fat Burn"},{"max":158,"min":130,"name":"Cardio"},{"max":220,"min":158,"name":"Peak"}]}}]}
Here are my setting concerning the request token

01-17-2017 08:10 - edited 01-17-2017 08:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-17-2017 08:10 - edited 01-17-2017 08:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@dsalerne You're using your client ID when you should be using your user ID.
https://api.fitbit.com/1/user/2287Q3/activities/heart/date/today/1d/1sec.json
2287Q3 - this is your client ID.
See my post on how to get your user ID and use that instead.
@AndrewFitbit wrote:
@dsalerne Your userId is not on that page, it's at the end of the URL when you click "View Profile" from your dashboard settings (you can also navigate there by clicking your profile image at: https://www.fitbit.com)

03-02-2022 00:50
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-02-2022 00:50
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi, I'm having trouble using someone else's user ID, can I ask you for advice?

