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

403 on everything

ANSWERED

Dear Reader,

 

so I managed to get the OAuth2 "Handshake". No I am facing 

problems with the API Calls.

 

string apiCall = ToFullUrl("/1/user/{0}/profile.json", ClientId);

// apiCall looks like https://api.fitbit.com/1/user/{ClientId}/profile.json"

 

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiCall);
request.Method = "GET";
request.Headers["Authorization"] = "Bearer " + accesToken; 
request.Accept = "application/json";

 

myResponse = request.GetResponse();

 

after that call it throws a 403 Exception altough I do have all the permissions which I Require for that

call. (For debugging purposes I ll ask for every scope)

 

Has anybody corrections or tipps how I should proceed? 

 

Thanks for your help

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi @DeniOcean 

 

I'm glad you got the API call to work.  Using a hyphen (-), we are pulling the userId from the access token.  You should be able to specify either the Fitbit UserID with the Get Profile endpoint.   The API call would look something like this

 

https://api.fitbit.com/1/user/ABC123/profile.json

 

If you would like me to help debug why specifying the userId isn't working, please private message me your client ID and the user ID in the Get Profile endpoint.

 

Gordon  

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

After a few tries I figured out that the http request does not need the userId 

"/1/user/{user-id}/profile.json" I mentionned above. You HAVE to make a dash [-] as user-id.

 

Well that kind of means that the fitbit Api recognises the User by their Token am I Right?

 

Best Answer
0 Votes

Hi @DeniOcean 

 

I'm glad you got the API call to work.  Using a hyphen (-), we are pulling the userId from the access token.  You should be able to specify either the Fitbit UserID with the Get Profile endpoint.   The API call would look something like this

 

https://api.fitbit.com/1/user/ABC123/profile.json

 

If you would like me to help debug why specifying the userId isn't working, please private message me your client ID and the user ID in the Get Profile endpoint.

 

Gordon  

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