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

API to find out when the user last synced their data with the FitBit device

ANSWERED

Hi, 

we are working on an iPhone app where we have integrated our app with Fitbit and implemented Implicit Grant Flow for the the authentication.

 

Right now, unless the user updates their FitBit data by launching the FitBit app and syncing, before using our iPhone app, their data would not be registered leaving their data in the past.

Is there a way our app would know when was the last sync happened for that fitbit user?

 

Thanks

Ekta

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi @ektay 

 

If you requested the settings scope and the user consented to share that data with your application, then the Get Devices endpoint will let you know when the user last sync'd their device.  See https://dev.fitbit.com/build/reference/web-api/devices/#get-devices.

 

Another option is to implement the Subscription API.  Anytime a user syncs their device, manually enters data or we receive data from a 3rd party application which the user has also authorized, you will receive a notification that new data is available for downloading.   See https://dev.fitbit.com/build/reference/web-api/subscriptions/

 

Gordon

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

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

Hi @ektay 

 

If you requested the settings scope and the user consented to share that data with your application, then the Get Devices endpoint will let you know when the user last sync'd their device.  See https://dev.fitbit.com/build/reference/web-api/devices/#get-devices.

 

Another option is to implement the Subscription API.  Anytime a user syncs their device, manually enters data or we receive data from a 3rd party application which the user has also authorized, you will receive a notification that new data is available for downloading.   See https://dev.fitbit.com/build/reference/web-api/subscriptions/

 

Gordon

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

Can I use the subscription APIs in implicit grant flow. If the authorization is done through the iOS app?

Best Answer
0 Votes

Yes, you may.  The Subscription API is not dependent on the authorization flow you use.  

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