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

Project

Hello,

 

I'm doing a project for my University and I'm trying to use de fitbit API.

 

The idea is to get the data from the central servers of FITBIT where the watch send the data, through a batch executed periodically. 

 

I have read the docu but there are some things that I didn't get. 

 

What application type do I have to use? server?

How I upload the app to the central servers?

Any language recommended?

 

If you link me some info for me is enough.

 

Thanks in advance,

Fran

 

Best Answer
0 Votes
8 REPLIES 8

Hi @Ganchito 

 

  • The Web API application type is based on the architecture of your application.   See https://dev.fitbit.com/build/reference/web-api/developer-guide/getting-started/#Application-Types.  To query your participant's data, you will need to set the application type to either "client" or "server". 
  • You do not need to upload your Web API application to Fitbit.   When you register your application on dev.fitbit.com, you will receive a client ID and client secret.   Using these two things in your code will trigger Fitbit that you have an authorized application to pull Fitbit user data.
  • You may use any programming language as long as there is an OAuth 2.0 library available.   We list some popular ones here: https://dev.fitbit.com/build/reference/web-api/developer-guide/libraries-and-sample-code/.   I am not endorsing its use but from personal experience, Scribe Java is easy to setup and is continually maintained. There are plenty more available which are not listed on our site.   You can find them through internet searches.

Gordon

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

Hi Gordon,

 

First of all, thank you for the answer, it has helped me.

I have advanced in my project and the next week I will bring some more doubts.

At this moment there is still one thing I don't get his use. The user-id in the petitions. For example: /1/user/-/activities/date/{date}.json.

The '-' corresponds to the current user logged, but in the petition, I also have to send the auth token (who represents the user logged), so what use has the 'user-id' there?

 

Fran

Best Answer
0 Votes

Hi @Ganchito 

 

You will always need to provide the access token which lets Fitbit know which user's data you are requesting.   By specifying the "-", you are just requesting the user's data based on the access token.   If you enter the user id into the endpoint, (i.e. /1/user/ABC123/activities/date/{date}.json), then we will validate the user id in the endpoint declaration against the access token.   Either option is acceptable.

 

Gordon

 

 

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

Hi @GordonFitbit,

 

So as summary: the "user id" field it's optional, and only is necessary if we want to confirm that the access token is the correct one in relation to the user we are looking at?

Best Answer
0 Votes

Correct.   Providing the user id value is optional.   It's common for developers to just provide the "-".

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

Hi, I am developing the API to display information to the user as a project for my university. But I don't have any fitbit device in my hand right now. Is there any way to mock this database of a user?

Best Answer
0 Votes

Hi @Ganchito 

 

You can manually log the activity, nutrition, sleep and weight data through either fitbit.com or the mobile application.  Also, you can add MobileTrack as the Fitbit device in the mobile application to use your mobile phone as a pedometer.

 

Gordon

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

Great idea, friend! However, I believe that the implementation of such a scientific project is quite difficult to implement in practice. To do this you need to have special knowledge and experience. Therefore, the best solution to get an excellent result is to seek help from professionals on https://assignmentbro.com/ca/accounting-assignment-help the online service from which I ordered the writing of an academic paper on accounting. The result pleasantly surprised me - the quality of the work was high, and I had time for other subjects. However, I understand that using such services is not always ethical, so you should consider them as an additional resource when absolutely necessary.

Best Answer
0 Votes