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

Web API issue importing nutrients

Trying to import nutrients from Fitbit into Cronometer.

I am already importing the nutrients that are available in the web dashboard (i.e Calories, Fat, Fiber, Carbs, Sodium, Protein).

I am trying to add the additional nutrients mentioned in the API docs (in the create food log section).

Unfortunately I can't see those nutrients being imported in the mobile dashboard, it only displays the macronutrients.

Is this a known issue?

I'm trying to post the request url and reponse here but i'm getting an error that i'm not allowed to include certain numbers.

Thanks,

Georges

Best Answer
0 Votes
3 REPLIES 3

Hi @gassouad,

Welcome to the forums!

Can you try using the "insert code sample" feature in the text tool bar to paste your request and response? I'd like to try and reproduce and confirm with engineering after. Otherwise, you can PM me the request and response if that is easier.

Thanks!

 

Best Answer
0 Votes

It was still complaining about the date so I removed it but the rest worked. Here you go, let me know if you need more info

 

Request: https://api.fitbit.com/1/user/123ABC/foods/log.json?foodName=Cronometer+Food&brandName=Cronometer&mealTypeId=7&unitId=1&amount=1.0&date=-&potassium=418.08&transFat=0.14&dietaryFiber=0.4&vitaminB6=0.48&protein=33.37&satFat=6.53&cholesterol=165.62&copper=0.14&vitaminB12=0.2&iodine=14.07&zinc=1.81&phosphorus=269.34&totalFat=63.11&sugars=6.83&calcium=20.1&vitaminC=0.0&vitaminE=16.04&vitaminD=8.04&biotin=4.02&magnesium=34.17&totalCarbohydrate=7.44&calories=720&sodium=245.22&caloriesFromFat=561&iron=1.43&vitaminA=227.13&folicAcid=18.09

Response: {"foodDay":{"date":"-","summary":{"calories":720,"carbs":7.44,"fat":63.11,"fiber":0.4,"protein":33.37,"sodium":245.22,"water":0}},"foodLog":{"isFavorite":false,"logDate":"-","logId":33903188946,"loggedFood":{"accessLevel":"PRIVATE","amount":1,"brand":"Cronometer","calories":720,"foodId":0,"mealTypeId":7,"name":"Cronometer Food","unit":{"id":1,"name":"almond","plural":"almonds"},"units":[1]},"nutritionalValues":{"calories":720,"carbs":7.44,"fat":63.11,"fiber":0.4,"protein":33.37,"sodium":245.22}}}

 

 

Best Answer
0 Votes

@JohnFitbit please see post above 

Best Answer
0 Votes