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

Oauth2 getting started?

Hi all

 

I am wanting to do a data presentation experiment with my fitbit data using possibly Angularjs or just plain old JS for a web app. Its a little personaly project of mine as I am trying to develop my coding skills.

 

I have setup my application with fitbit and have been given the Oauth 2.0 client ID, Client Secret, Auth URI and Access/refresh tolen URI.

 

I have never touched Oauth before so I am a little confused.

I plan to use the implicit grant flow rather than the code grant, is this advisable?

 

I also had a look around on github for libraries to help me with the authorization part of it as I am not quite sure how to implement what the Fitbit documentation says to do.

 

I am currently testing out this but I have an error:

https://github.com/pavelrisenberg/fitbitphp

 

 

Class 'OAuth' not found

I am guessing OAuth is a library which needs to be installed or on a server?

I am running this on a local host currently.

 

I am also trying to go through the debug tool and after following the instructions I need getting:

Developer information: unauthorized_client - The client is not authorized to request an access token using this method.

 

Thanks

Hayley

Best Answer
0 Votes
4 REPLIES 4

I don't believe that PHP library linked is for OAuth 2.

 

Use Authorization Code Flow if your app runs on your own server and your server makes requests to the Fitbit Web API. Use the Implicit Grant Flow if your app runs client-side (e.g. Web browser, "native" mobile app).

 

Here is a Node.js example: https://github.com/jeremiahlee/fitbit-hapi-demo

 

Here is a Web browser app example: https://github.com/jeremiahlee/fitbit-web-demo

Best Answer
0 Votes

Thank you, I will give it a try 🙂

Best Answer
0 Votes

I am an iOS developer and integrating the Fitbit APIs in one of my app. I was successful in getting data and everything worked but I am stuck with a limit problem issue. I know there is a limit of 150 calls per hour per user but its happening too early. I am using two accounts for the testing purposes and one of the accounts gives this error too early even we have not called the API 150 times. I need to deliver that app to my client and stuck in this issue from weeks please help me in this. How can we utilize the limit in the best way and also is there a way to increase the limit too? So, whats the best method to get the data in order to remove this limit error? I want to get updated after every 5 seconds.

Best Answer
0 Votes

I am an iOS developer and integrating the Fitbit APIs in one of my app. I was successful in getting data and everything worked but I am stuck with a limit problem issue. I know there is a limit of 150 calls per hour per user but its happening too early. I am using two accounts for the testing purposes and one of the accounts gives this error too early even we have not called the API 150 times. I need to deliver that app to my client and stuck in this issue from weeks please help me in this. How can we utilize the limit in the best way and also is there a way to increase the limit too? So, whats the best method to get the data in order to remove this limit error? I want to get updated after every 5 seconds.

Best Answer
0 Votes