RubeySchulz / Health-App

0 stars 0 forks source link

Finding a food calorie counting API with good documentation #6

Open RubeySchulz opened 2 years ago

RubeySchulz commented 2 years ago

https://www.nutritionix.com/business/api

RubeySchulz commented 2 years ago

Server API calls

USER GET /api/users - lists all users GET /api/users/:id - list single user of whatever ID is input POST /api/users - creates a user, expects a JSON body of "{email: 'lernantino@gmail.com', password: 'password1234'}" POST /api/users/login - logins user, expects "{email: 'test@test.com, password: test}" (saves a session/cookie so if you login once, you'll be logged in until the logout route is called) POST /api/users/logout - deletes current session/Logs out user. PUT api/users/:id - updates user at id, probably wont use this one DELETE /api/users/:id - deletes user at id, probably wont use this either.

DAY GET /api/days - lists all days GET /api/days/:id - list single day of whatever ID is input POST /api/days - creates a new day, expects {calories_consumed: 100, calories_burned: 50, user_id: 1} PUT /api/days/:id - updates a day, will be used to add nutrients and calories to current day. expects {calories_consumed: 100, calories_burned: 50, user_id: 1} DELETE /api/days/:id - deletes day at :id, probably wont use this one either

NUTRIENTS GET /api/nutrients - lists all nutrient tables GET /api/nutrients/:id - list single nutrient table of whatever ID is input POST /api/nutrients - creates a new nutrient table (linked to a day), expects {carbs: 20, proteins: 20, fats: 30, sodium: 400, cholesterol: 600, date_id: 1} PUT /api/nutrients/:id - updates a nutrient table, will be used to add nutrient count to the current day the nutrient table is attached to. expects {carbs: 20, proteins: 20, fats: 30, sodium: 400, cholesterol: 600, date_id: 1} DELETE /api/nutrients/:id - deletes nutrient table at :id, probably wont use this one either