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

Activities synced from fitbit device not being returned via api.

A user has some exercises on his mobile app that were synced from their fitbit tracker (Charge HR) but when we get activities via the API we get an empty array. When we check it for user's that have logged activities manually via the fitbit app everything is fine.

Best Answer
0 Votes
8 REPLIES 8

@digital_wellbei Use the Get Activity Logs List endpoint.

 

Here's an example:

https://api.fitbit.com/1/user/-/activities/list.json?limit=10&sort=desc&beforeDate=2016-03-30&offset=0

 

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

Hi @AndrewFitbit, thank you for your response. If we want to get data on both exercise and steps, does this mean that we will have to use both the Get Activity Logs List as well as the Get Daily Activity Summary endpoint?

Best Answer
0 Votes

@digital_wellbei You can probably just use the Get Activity Logs List endpoint to get the data you're looking for.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

@AndrewFitbit But the two endpoints aren't consistent? It must be possible to get all steps and exercise accurately from a singly endpoint/request?

 

Example User

day: 26th Jan 2017

 

1. Get Daily Activity Summary
activities: []
steps: 5384

 

2. Get Activity Logs List
activities: [Aerobic Workout: {steps: 1498}]
steps_summary: Not Given

Best Answer
0 Votes

@digital_wellbei Sorry, I misunderstood.

 

Depending on the user's data, then yes you would have to use both endpoints because only manual logTypes will show up in the summary endpoint.

 

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

What do you mean by "Depending on the user's data"? We have thousands of users that want to sync their fitbit exercise and steps to our app. Why on earth would one enpoint provide data from a wristband and another provide data that was manually entered to the app? This makes no sense to me at all.

 

Surely once it's synced to the user's Fitbit account, steps are steps and exercise is exercise...?

 

Requesting data from two endpoints is something we are very keen to avoid and we have been doing so for some time until recent updates to the API. There must be another way?

Best Answer
0 Votes

@digital_wellbei Meaning if a user doesn't have any logged activities or they only have manually logged activities, then you could just use the summary endpoint, but if a user has activities in their log other than manually logged activities, then you need to use activity logs list endpoint.

 

 

We would remove manual activities from being returned in the summary but that would be a breaking change. That's why they've been left in. See Jeremiah's point here.

 

You're requesting two different things, that's why they're two different endpoints. Summary isn't just returning steps, it's a summary of a user's stats for a given day. Activity logs list gives you a detailed list of exercises.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer

@digital_wellbei: Perhaps a little history will help. Fitbit devices used to not be able to a track many types of exercises well—cycling, yoga, elliptical, other non-ambulatory activity. So Fitbit created a way for people to manually log activity. These manual logs overrode the tracker's data because a person saying they did an activity has high certainty in accuracy than what the accelerometer captured. These logs were returned in the Daily Activity Summary because they indicated what portion of the sums were not from a tracker.

 

Over time, Fitbit added several new types of sensors and developed awesome algorithms. Instead of overriding data from a Fitbit device, people could annotate period of their day as certain activity. This was a new feature and we created new endpoints to support these new features. This is why you should use the Get Activity Logs List endpoint.

 

Good API design practice is to keep unique resources separate, but linked. If you truly need a day's summary, use the Get Daily Activity Summary endpoint. Most apps opt to use the time series endpoints for just the data they need. If you want activity logs, use the Get Activity Logs List endpoint.

Best Answer
0 Votes