Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HTTP 403 - API client is not authorized by Fitbit - HVR request only

Hello

I have an application of Server Type.
For a few users, I am getting 403 on calling: https://api.fitbit.com/1/user/-/hrv/date/.../all.json
endpoint.
Response from FitBit:
API client is not authorized by Fitbit to access the resource requested. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process.

On the Fitbit DOCS the only recommendation that I found related to the above message is:
"If you application type is “Personal”, then the owner of the application can only query their intraday data."
So it can help me in the case when my app is server type.

The user has selected all scopes, (in fact it is my test user, so I have access to his account).

I found a related topic: https://community.fitbit.com/t5/Web-API-Development/Cannot-get-HRV-data-through-WebAPI/td-p/5187202
that says to reselect app type, but as I understand it will revoke all tokens, so clients will have to integrate once again.
It is not a certain solution and I will prefer to omit chaos

Thank for help

Best Answer
0 Votes
8 REPLIES 8

Hi @PawelRoman 

 

There could be several reasons that you're getting this error

 

  1. incorrect endpoint syntax - I'm guessing this is not the problem if you're using the same endpoint successfully for other users
  2. intraday access is not enabled for your application - I'm guessing this is not the problem if you're using the same endpoint successfully for other users
  3. the user has not enabled the heart rate scope - you stated the user enabled all scopes, so this is likely not the problem.
  4. The user has not enabled the "Health Metrics" tile in their mobile application - Since you said this occurs for some users and not all users, I'm guessing this might be the problem.   Please ask your impacted users to click on the Health Metric tile in the Fitbit mobile application.  This will enable HRV data collection.

Let me know if this does not solve the problem.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Thank you for your response

I am unable to find anything that might be related to "enabled the "Health Metrics" tile in their mobile application",
Are you able to provide me guide where it is?

Best regards

Best Answer
0 Votes

The tile should appear in the mobile application on the main screen.   Here's a picture of mine.

 

IMG-2788.jpg

 

There is some additional information in this help article: https://help.fitbit.com/articles/en_US/Help_article/2462.htm

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Thank you,
A user have the "Health Metrics" enabled, so it is not that

Best Answer
0 Votes

Hi @PawelRoman 

 

Do you get the 403 error when you query the non-intraday endpoint?   The syntax is https://api.fitbit.com/1/user/-/hrv/date/<date-value>/all.json

 

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Yes,
@GordonFitbit 

I am getting 403
error:
On calling endpoint: https://api.fitbit.com/1/user/-/hrv/date/<date-value>/all.json
Response: API client is not authorized by Fitbit to access the resource requested. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process


Best Answer
0 Votes

Hi @PawelRoman 

 

My apologies.   I gave you the incorrect endpoint.   Please try https://api.fitbit.com/1/user/-/hrv/date/<date-value>.json.  The "/all" should be removed to return the non-intraday data.

 

Thank you!

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Best Answer
0 Votes