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

Daily Activity Summary calories in "activities" returns string instead of number

We have recently received Daily Activity Summary's activities.calories is returning a string ("-23") instead of -23, eg:

{
  ...
    "activities" : [{
        ...
        "calories": "-23"
    }],
}

This behavior does not align with what was defined in the documentation (https://dev.fitbit.com/build/reference/web-api/activity/get-daily-activity-summary/) where calories is expected to be of Number type. 

Is this an intentional change or a bug? Thanks.

Best Answer
0 Votes
5 REPLIES 5

Hi @hi_SG 

Thank you for submitting your question. 

We will attempt to replicate the issue on our end. We’ll provide an update as soon as we can. 

Best Answer
0 Votes

 

Hi @hi_SG 

We attempted to replicate the behavior in our environment but have not been able to reproduce the error. To help us investigate why you're seeing a string instead of a number, could you provide a few more details?

  1. What is the exact Endpoint URL and date you are requesting? Is this happening for a specific day's summary, or is it occurring across all historical dates?

  2. Was the activity resulting in '-23' calories synced from a 3rd party app or manually logged?

  3. Could you provide the full JSON response?

 

Best Answer
0 Votes
Spoiler
 

Hi  @DorisFitbit,

1. Endpoint: .../1/user/${fitbitID}/activities/date/${date}.json, we were only able to identify for 29th Jan, but this occurred for multiple users, we are unsure if it occurred for other users on other days due to not having full access to the data. A similar issue has occurred before but there was no resolution: https://community.fitbit.com/t5/Web-API-Development/Daily-activity-summary-activeScore-returning-quo...

2. the activity resulted in "-23" calories was retrieved directly from Fitbit's endpoint, we do not do any additional manipulation to the data

3. Attached is a screenshot the full JSON response for a sample user

screenshot.png

Thank you!

Best Answer
0 Votes

Hi @hi_SG 

Thank you for sharing! 

We will investigate the issue and get back to you as soon as we have an update.

 

Best Answer
0 Votes

Hi @hi_SG 

We need more details from you. For privacy reason, I will send you an email so we can move this discussion to the Issue Tracker. 

Best Answer
0 Votes