Hi,
We are having a problem with Fitbit API, it is returing data different than what we see in Fitbit dashboard.
We used this fitbit account - renushankar@ymail.com
Attached is the logger data for fitbit data.
On fitbit site for the above account there are data for the month of september. But it sends 1 data from the current date,which was not actually added.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
where resource id, start date, and todays date are being filled in dynamically
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Please PM me with concrete API url and concrete page url you're comparing it to.
I know how the urls should look like. I need to investigate your concrete case.
This is why I need exact Fitbit Api url you're calling.
For the fitbit.com website you can just send me screenshot what you're seeng for the weight values.
Best AnswerIvan,
I sent you a private message with the requested data above. Please let me know if you need any further information.
Appreciate your help.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Ok, so based on API request you sent me in PM it seems to me as a valid behavior.
The thing is that you're calling TimeSeries endpoint that supose to auto-fill the weight with the latest weights that user posted if there is not weight logged for particular date.
if you're interested in list of days when user actually entered his weight you need to use this format:
https://api.fitbit.com/1/user/{your_user_id_here OR -}/body/log/weight/date/2014-11-04/2014-11-11.json
instead of this
https://api.fitbit.com/1/user/{you_user_id_here OR -}/body/weight/date/2014-11-04/2014-11-11.json
see https://wiki.fitbit.com/display/API/API-Get-Body-Weight for more details.
Best AnswerHello Ivan,
We changed the API calls to use the endpoint you suggested, but now we are seeing a different error:
Here is the exact call:
@OAuthRequest(GET, https://api.fitbit.com/1/user/2QX3TF/body/log/weight/date/2014-06-22/2014-11-13.json)
And here is the response:
{"errors":[{"errorType":"validation","fieldName":"endDate","message":"Invalid end date: 2014-11-13"}]}
Is this because this API has a limit of returning data for a maximum of 31 days ?
I saw that here: https://wiki.fitbit.com/display/API/API-Get-Body-Weight
end-date: Range end date when date range is provided. Note that period should not be longer than 31 day.
Thanks,
John
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Yep.
The error message in response does not describes the problem very well, but yep you're right, you'll see this error response when you request for data for more then 31 days.
We have a ticket to fix the message to be more descriptive, so the error message should be returning valid explanation when we address the thicket.
Best Answerto follow up on my previous post, what is the best practice, for say, retrieving 5 months of weight data ?
Should we run subsequent calls to /body/log/weight ? Or is there an easier way ?
Thanks,
John
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Yep, I'd suggest pulling by one month.
Best AnswerIf we do one month at a time, is there a limit on how frequently we can query and how many queries we can issue within a specific timeframe ? Do we have to throttle our requests?
Also, Can you please explain again how the timeseries API is different from the log api.
I am looking here: https://wiki.fitbit.com/display/API/API-Get-Time-Series
/body/weight vs /body/log/weight
Thanks
Best Answer
@Khaled wrote:
If we do one month at a time, is there a limit on how frequently we can query and how many queries we can issue within a specific timeframe ? Do we have to throttle our requests?
Best AnswerFor the time series api's ....
The documentation page (https://wiki.fitbit.com/display/API/API-Get-Time-Series) is not very detailed. Can you please answer these additional questions:
1) what is the maximum date range for time series API -- in days ? in months ?
2) is the data format the same as the /body/log/weight api ? So we could process the response in the same exact way ?
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Default limit is 150 requests per particular user per hour.
If you reach your limit for particular hour, you'll be able to make requests again when hour ends.
The main difference between weight log and time series is that time series normally returns only date+ value list. Where non-time series endpoint also return other useful information.
Some (not all though) endpoints may fullfill missing data, weight time series as you can see does it.
Best Answerok ... so in terms of filling missing data, can you please be more specific.
Is it repeating a weight value from the previous day if a value was not entered ?
So in effect, you see a weight value until a different value was entered by the user ?
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
@Khaled wrote:
ok ... so in terms of filling missing data, can you please be more specific.
Is it repeating a weight value from the previous day if a value was not entered ?
So in effect, you see a weight value until a different value was entered by the user ?
yes.
Best Answer.... and I am sure there is no specific way for us to detect that a weight value returned by time series API was filled in by the API or entered by the user.. right ? Or is there a way 🙂
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Unfortunately no, I posted above the only way you can do it for your use case .
You need to use non timeseries endpoint for that.
Best AnswerHello Ivan,
One more question regarding the log api. How far back can we query for data ?
Is it also a max of 1 year, as the timeseries api ?
Thanks,
John
Best Answer