03-20-2023 13:42
03-20-2023 13:42
I have logged the following lunch foods:
I'm using this api call to get the data.
https://api.fitbit.com/1/user/-/foods/log/date/<date>.json
I get all of the food items, but not all of the nutritionalValues in the JSON. There's Calories, Fat, Fiber, Carbs, Sodium & Protein for the Chicken Burrito, but not for the other two. Why? Should I use a different api call? Is it just not available? Is there a bug?
10-03-2023 15:11
10-03-2023 15:11
@Gordon-C Hi there! Hope you had a great summer! Checking in to see if there's any update on this issue? Thanks much!
11-24-2023 19:13
11-24-2023 19:13
Not sure if it provides any additional context but there does appear to be a difference in response data over curl depending on the authorization header used.
For example when using the authorization token for the Swagger API I get this data
"loggedFood": {"accessLevel": "PUBLIC", "amount": 1, "brand": "Del Monte", "calories": 30,
"foodId": 14725566, "locale": "en_US", "mealTypeId": 1, "name": "Pears, Diced",
"unit": {"id": 91, "name": "cup", "plural": "cups"},
"units": [305, 91, 256, 279, 226, 180, 147, 389]},
"nutritionalValues": {
"calories": 30,
"carbs": 8,
"fat": 0,
"fiber": 1,
"protein": 0,
"sodium": 0}},
But when using the token from my app I do not get the Nutritional Information
"loggedFood": {"accessLevel": "PUBLIC", "amount": 1, "brand": "Del Monte", "calories": 30,
"foodId": 14725566, "locale": "en_US", "mealTypeId": 1, "name": "Pears, Diced",
"unit": {"id": 91, "name": "cup", "plural": "cups"},
"units": [305, 91, 256, 279, 226, 180, 147, 389]}},
May also be worth noting that custom foods which have "accessLevel": "PRIVATE" do return their nutritionalValues.
11-28-2023 14:34
11-28-2023 14:34
That's very interesting. I'll have to look into it. Thanks very much!