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

How to get our specifc user details or all friends details.

How to get our specifc user details or all friends details.

Like I want to get the Profile or Bages earned by my friends so if in endpoint I try to amend their userid (encodedid), I get error stating insufficient permissions. Can anyone help me here what endpoint should be used or what permissions should be enabled.

Endpoint currently being used: https://api.fitbit.com/1/user/-/profile.json

Best Answer
3 REPLIES 3

Hi @sachiagarwal 

 

To retrieve your friends information, your friends needs to authorize content to share their data with your application.  Your application needs to execute the Outh2 authorize endpoint which presents the scopes to the user.  The user will need to select profile for you to get the badges.  Once they have consented to share this data, your application will receive an access token which you'll specify when executing the Get Profile endpoint.

 

If you need more information, please let us know.

 

Gordon

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

Just to clarify...

If I want to get get badges for several friends, does each friend have to consent to share using my app on my device?  Then will I get separate access tokens (and refresh tokens) for each user ID and use their specific access token when executing the Get Profile endpoint?  Or, does each friend give consent to share using my app on their device, and my app stores their separate access tokens (and refresh tokens) in a centralized database?

Thanks in advance,

Phil

Best Answer
0 Votes

Hi @pwstern,

 

You're correct. When each user gives consent to share their data using your app on their device, your app stores their tokens on a server or centralized database. During the authorization process, the auth code is sent to your redirect URI, which generally where this process is hosted. 

 

I hope this helps. Let me know if you have any additional questions.

Best Answer
0 Votes