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

Subscription API only reporting activities changes

Hi,

 

   I've registered to get push notifications. I've used the following url format to create a subscription /1/user/-/apiSubscriptions/320.json. My understanding is I should get callbacks when changes are detecting on device sync for all metrics ie foods, activity, sleep, body. My user granted all scopes. My endpoint correctly receive notifications when my user sync the device. However, I am only getting notification when activities changed ie no sleep/body or foods pushes. I thought the subs url I am using would allow me to receive all metrics that have changed but all I seem to get are activities notifications.

 

What am I missing?

Best Answer
0 Votes
3 REPLIES 3

What you're describing it correct behavior.

Fitbit notifies you that something had changed. It's your application's decision whether go and fetch this change from Fitbit API or not.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

Thanks Ivan! I got that. My issue is when I sync my device all I see are notifications with collection_type set to activities. Was expecting sleep collection types when I sync my device first thing in the am. Obviously that data changed yet no sleep notifications. Reading the subscription docs I should be getting one of activities, food, sleep, body. But only seeing activities notifications. Are you saying that I will never get a collection_type=sleep and it is my responsibility to check sleep and other metrics upon activities changes?

Best Answer
0 Votes

The sleep edetection does not happens immediatelly. So it's not guaranteed that you'll get it as a first thing in the morning when you wake up.

 

Once fitbit servers detect new sleep was logged it will send yuo push notification.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes