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

Fitbit API Error: HTTP protocol error 401 (Unauthorized): Requested resource requires authentication

ANSWERED

I am trying to send connect to Fitbit from Qliksense to visualize my Fitbit data.

I have the access_token and the API calls are working fine from POSTMAN but not with Qlik.

I get the below error when connecting:

HTTP protocol error 401 (Unauthorized): Requested resource requires authentication.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi, @JohnFitbit @Synosure,

 

I was able to resolve the issue as I was passing my access_token with an incorrect header name.

 

The correct way is:

Name :             

authorization   

Value:

Bearer your_acces_token

 

Now I have access to my Fitbit data via Qlik

 

@Synosure 

 

I'll let you know the steps I used:

 

1. I registered my app on https://dev.fitbit.com/apps/new

2. After registering your app, you get your user id and you get an  OAuth 2.0 Tutorial Page link that you can access and flow the steps to get an access token.

3. Once you have endpoint URL (you can determine the URL from here https://dev.fitbit.com/build/reference/web-api/ based upon what data you want)

and your acces_token you can make API calls (you can test whether it's working on POSTMAN initially). 

 

I'll suggest watching a youtube tutorial for all these steps, I followed the below:

 

https://youtu.be/X0RDQWbJw9I

 

View best answer in original post

Best Answer
5 REPLIES 5

Hi @DeepaliChakre,

 

Welcome to the forums!

 

I actually haven't encountered the error "401 (Unauthorized): Requested resource requires authentication" before, so this is new to me. Can you tell me what stage in the authorization process this error is being returned?

 

Since I don't have any experience with Qlik, can you do additional testing and see if there is a difference between how you are authorizing in Postman vs Qlik? If you like, you PM me a screenshot of your configuration and I'll see how I can help.

 

Hope to hear from you soon!

Best Answer
0 Votes

Sorry I would like to know how did both of you solved this issue because I wanted to use this API for University projects and I have this exact same error

Best Answer

Hi @Synosure,

 

Welcome to the forums!

 

I haven't encountered this error before. So that I can investigate, can you share the steps you took to reproduce the error? Where in the authorization process are you seeing this error?

Best Answer

Ok, I discovered this API in the webpage https://www.programmableweb.com/api/fitbit-rest-api-v1 and used the "API Endpoint" that is showed in there

that uses this link https://api.fitbit.com/ and there is when it says:

Authorization Error: Invalid authorization token type

 

Best Answer
0 Votes

Hi, @JohnFitbit @Synosure,

 

I was able to resolve the issue as I was passing my access_token with an incorrect header name.

 

The correct way is:

Name :             

authorization   

Value:

Bearer your_acces_token

 

Now I have access to my Fitbit data via Qlik

 

@Synosure 

 

I'll let you know the steps I used:

 

1. I registered my app on https://dev.fitbit.com/apps/new

2. After registering your app, you get your user id and you get an  OAuth 2.0 Tutorial Page link that you can access and flow the steps to get an access token.

3. Once you have endpoint URL (you can determine the URL from here https://dev.fitbit.com/build/reference/web-api/ based upon what data you want)

and your acces_token you can make API calls (you can test whether it's working on POSTMAN initially). 

 

I'll suggest watching a youtube tutorial for all these steps, I followed the below:

 

https://youtu.be/X0RDQWbJw9I

 

Best Answer