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

Can I get the data without knowing client ID?

Hi

 

I'm trying to use Fitbit for my research and getting data from a bunch of study participants. As client ID is private data, I'd like to access the data without knowing the participants' client ID. However, it seems most manual requires to know the client ID to use API. Is there any way to solve this issue?

 

Thanks

Best Answer
0 Votes
5 REPLIES 5

Hi @Spring223,

 

Welcome to the forums!

 

Do you mean the User ID? When fetching data from a user, you have to specify the Fitbit user's user-id in the endpoint, for example:

GET https://api.fitbit.com/1/user/[user-id]/activities/date/[date].json

However, if you have access to the account you wish to pull data from, you can instead use "-" in place of the user-id in the url.

 

A client id is your unique oAuth 2.0 application id that should be stored in your application's code. This information is used in part with your client secret as a Basic Base64 token in the authorization header for endpoints used in obtaining an access token and/or refresh token.

 

A user-id is a unique id associated with a user's Fitbit account. When fetching data from a user, their user-id must be specified in the endpoint (above) to ensure that you're pulling data from the correct user. There isn't a way to pull user data without specifying their user-id, unless you had physical access to that account and logged in. 

 

I hope this helps. Let me know if you need additional clarification.

Best Answer

Hi JohnFitbit. Thanks for the clarification.

 

What I have in my mind is this:

1) Study participants log in to Fitbit

2) Authorization page to access data is showing up

3) Participants see their weekly step count

 

About your suggestion, I think I'd use "-" instead of "[user-id]. However, still, I think I need to know their access token which requires client ID. Is there any other suggestions?

Best Answer
0 Votes

Hi @Spring223 ,

 

Did you find solution to your problem? I am facing the same issue where I need to get data without clientID or need a way to get clientID for potential users for the application.

 

Thanks

Best Answer

I'm facing with same issue when I want to run my app Modapills as well.

 

Moderator Edit: Formatting

Best Answer
0 Votes

Hi @voliotDev and @modapillsriver,

 

Hopefully, this clears up the confusion.

 

The client ID is the id associated with the application.   You will need this and specify it in your application code.   To find the client ID, log into your dev.fitbit.com account, select the application which will be used to pull the data and the client ID will be displayed on the summary page.   If you have not registered an application yet, you will need to do this.   See https://dev.fitbit.com/build/reference/web-api/developer-guide/getting-started/ for help.

 

If you actually mean the user ID, then this is possible.  Instead of providing the user id in the endpoint syntax, use "-" instead.  When the call is executed, Fitbit will use translate the hyphen to the user id specified in the access token.

 

Best,

Gordon

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