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

web api for nutrition time series endpoint change in response type

Previously this web api endpoint
/1/user/[user-id]/foods/log/[resource]/date/[start-date]/[end-date].json

returned values in string format like below

{

  "foods-log-water": [

    {

      "dateTime": "",

      "value": "0.0"

    },

    {

      "dateTime": "",

      "value": "0.0"

    },

 

currently its responding with number

{

  "foods-log-water": [

    {

      "dateTime": "",

      "value": 0

    },

    {

      "dateTime": "",

      "value": 0

    },

 

Is this change intended, the api doc still shows string values in example response ?
https://dev.fitbit.com/build/reference/web-api/nutrition-timeseries/get-nutrition-timeseries-by-date...



Best Answer
0 Votes
3 REPLIES 3

Hi @cvc_2025 

Thanks for posting your question! I was able to reproduce the problem where it returned "value": 0 

I will be filing a bug to engineering team to investigate the issue. 

Best Answer
0 Votes

@cvc_2025 

I will need to get more information from you to investigate this issue.   I just sent you a message through Issue Tracker.

Thanks!

Best Answer
0 Votes

Bro I ran into this exact thing before, and yeah, it caught me off guard too. The endpoint switching from string to number is not really documented properly, but it seems like they updated the backend for consistency. Your code might need a small tweak to handle numbers instead of strings now. When I was testing similar API changes while working on my Hypic project, catching these subtle changes early saved me a lot of debugging headaches.

Best Answer
0 Votes