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

Using fitbit api and get user data

ANSWERED

1.Right now I've an android apps related to health care and I've created an user interface for allowing fitbit user to share their data with my apps. when they are allowing me by pressing allow button is it true? by allowing on the user automatically added as a subscriber in my application(which is created in https://dev.fitbit.com/apps ).If yes then my question is how can I differentiat or identify user?

2.When an user subscribed to my application(Fitbit application) and my callback url notify for the user is it? If yes then which data belongs to notify my callback url?.

3.Is there any limitation about subscriber? If yes then how many subscribe I've added in one application?

 

Note: my calback url is a wcf web service

 

Thanks in Advanced!

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Everytime user clicks "Allow" button Fitbit will be issuing the request to the callback url that you specify in you app settings.

Once you get the request and exchange your temp token with permanent token you can just create subscription in your code by using https://wiki.fitbit.com/display/API/Fitbit+Subscriptions+API#FitbitSubscriptionsAPI-Addasubscription

endpoint.

Everytime Fitbit will send you push notifications it will be sending user id with it so it should be easy for you to detect what user this push notifications belongs to.

Ivan Bahdanau
Senior Software Developer at Fitbit

View best answer in original post

Best Answer
6 REPLIES 6

Subscription is never created automatically. You need

1) Create subscriber in your application's settings. 

2) Susbcribe user to this subscriber.

 

Each subscriber has it's own endpoint url that Fitbit will fetch if subscriber is subscribed to listen to the entity that was updated.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

"Subscription is never created automatically"

:(. If an uesr allow to share their data then it's create automatically subscription in my application(fitbit apps) is not it? If is not it then it is tough to me or is it not possible to set subcription by manually!!! because I've lots of user

Best Answer
0 Votes

Everytime user clicks "Allow" button Fitbit will be issuing the request to the callback url that you specify in you app settings.

Once you get the request and exchange your temp token with permanent token you can just create subscription in your code by using https://wiki.fitbit.com/display/API/Fitbit+Subscriptions+API#FitbitSubscriptionsAPI-Addasubscription

endpoint.

Everytime Fitbit will send you push notifications it will be sending user id with it so it should be easy for you to detect what user this push notifications belongs to.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer

Now I'm clear.

Thank you very much

Best Answer
0 Votes

Hi, 

 

I have a similar issue. I also made a unity application and I am trying to use fitbit data with it.

I found this  unity project, https://github.com/TravisEvashkevich/UnityFitbit which is amazingly helpful. After I ran the project thought, as expected it took me to the authorisation page, and after I clicked allow it took me to my callback url. Therefore, I don't know how to get the value of my new returnCode/code which then remains null, so I can't use any getData functions. 

 

Any idea what I am doing wrong? 

 

Forgive me if my question seems foolish, I just literally started trying to work out how extracting data from fitbit works and I am stuck here the last couple of days, so I thought I should ask. xD 

Best Answer
0 Votes

worked it out, never mind xD

Best Answer
0 Votes