04-12-2015 18:56
04-12-2015 18:56
Just started messing around with the API to pull data in from other services and post it to FitBit. I've noticed that after I log an activity via the API, that it doesn't count towards my daily totals. If I look at the activity, it shows the mileage i've passed to it but on my dashboard the miles from the activity i've logged via the API don't count towards my daily total.
Is that expected behavior?
04-14-2015 14:31
04-14-2015 14:31
Anyone? I'll provide an example. Below I threw together arbritrary values in 'test_json'. I've got another, 'fitbit_json', with real data pulled from another source. I'll pass them both into log_activity to do a POST against the API. It's successful, below is the data it returns. Both activities show up in my fitbit activity log, yet only test_json has all relevant data tallying against daily totals. Not sure what i'm doing wrong here.
>>> test_json
{'manualCalories': 450, 'distance': 3.1, 'activityId': '90009', 'durationMillis': 1680000, 'startTime': '14:00', 'date': '2015-04-14'}
>>> fitbit_json
{'manualCalories': 570, 'distance': 2.96, 'activityId': '90009', 'durationMillis': 1812000, 'startTime': '15:53', 'date': '2015-04-14'}
>>> fitbit_obj.log_activity(test_json)
{u'activityLog': {u'activityParentName': u'Run', u'description': u'6.7 mph (9 min/mile)', u'isFavorite': False, u'distance': 3.099996, u'lastModified': u'2015-04-14T21:28:29.228Z', u'logId': 195804763, u'hasStartTime': True, u'calories': 450, u'activityParentId': 90009, u'activityId': 12060, u'steps': 5313, u'startTime': u'14:00', u'duration': 1680000, u'startDate': u'2015-04-14', u'name': u'Run'}}
>>> fitbit_obj.log_activity(fitbit_json)
{u'activityLog': {u'activityParentName': u'Run', u'description': u'6 mph (10 min/mile)', u'isFavorite': False, u'distance': 2.959995, u'lastModified': u'2015-04-14T21:28:38.081Z', u'logId': 195986028, u'hasStartTime': True, u'calories': 570, u'activityParentId': 90009, u'activityId': 12050, u'steps': 5073, u'startTime': u'15:53', u'duration': 1812000, u'startDate': u'2015-04-14', u'name': u'Run'}}