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

HTTP/1.1 401 Unauthorized How to Fix?

Hi,

I'm using the FitBit API Auth from GitHub (https://github.com/thephpleague/oauth2-client).

Everything works fine. I start the Site "index.php" on my Webserver the Site redirect me to the Auth-Page from FitBit. I Agree the Auth and Fitbit redirect me back to my Website with the URL: login.php?code= And a lot of Numbers and Letters.

Now i want to Get the profile.json but everytime i trying to Open the site it say:


Warning: file_get_contents(https://api.fitbit.com/1/user/-/profile.json😞 failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized

 

I don't know what i'm doing wrong. Could someone Help me?

Best Answer
0 Votes
1 REPLY 1

There has been a couple of cases with this. 

Mine being one of them. There is also another thread below with the same error.

 

Once you have the code, you are supposed to do a server request with it to access the data.

https://www.hurl.it/ - This helps with the request but again, I get the 401 error along with a missing header.

 

Best Answer
0 Votes