Open AsaGrote opened 1 month ago
Flow #1: Tracking daily calories and inputting workouts
POST /goals Curl
curl -X 'POST' \ 'https://nutrition-pal.onrender.com/goals/48' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "goal": "lose weight", "type": "diet", "daily_calories": 2000 }'
Response Body
"OK"
POST /meal Curl
curl -X 'POST' \ 'https://nutrition-pal.onrender.com/meal/48' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Mexican", "calories": 800 }'
Reponse Body
GET /daily_calories Curl
curl -X 'GET' \ 'https://nutrition-pal.onrender.com/daily_calories/48' \ -H 'accept: application/json'
{ "calories_left": 1200 }
curl -X 'POST' \ 'https://nutrition-pal.onrender.com/meal/48' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Italian", "calories": 1200 }'
{ "calories_left": 0 }
GET /meal/day Curl
curl -X 'GET' \ 'https://nutrition-pal.onrender.com/meal/48/day' \ -H 'accept: application/json'
[ { "name": "Mexican", "calories": 800, "time": "2024-05-21T04:41:51.659239+00:00", "type": null }, { "name": "Italian", "calories": 1200, "time": "2024-05-21T04:43:49.107473+00:00", "type": null } ]
Flow #2: Adding and looking up workout
curl -X 'POST' \ 'https://nutrition-pal.onrender.com/goals/48' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "goal": "get big", "type": "workout", "daily_calories": 2800 }'
POST /workout Curl
curl -X 'POST' \ 'https://nutrition-pal.onrender.com/workout/48' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "push-up", "sets": 3, "reps": 10, "length": 14 }'
Internal Server Error
GET /workout/{customer_id}/day Curl
[]
GET /workout/muscle_group/{type} Curl
curl -X 'GET' \ 'https://nutrition-pal.onrender.com/workouts/muscle_groups/back' \ -H 'accept: application/json'
[ { "name": "lat_pulldown", "type": "back", "group": "lats" }, { "name": "cable_row", "type": "back", "group": "traps" }, { "name": "pull_up", "type": "back", "group": "lats" }, { "name": "bent_over_dumbell_row", "type": "back", "group": "lats" } ]
Flow #3: Finding workout muscle_groups
GET /workout/{workout_id}/muscle_groups Curl
curl -X 'GET' \ 'https://nutrition-pal.onrender.com/workout/19/muscle_groups' \ -H 'accept: application/json'
[ { "name": "shoulder_press", "type": "arms", "group": "shoulders" } ]
Flow #1: Tracking daily calories and inputting workouts
POST /goals Curl
Response Body
POST /meal Curl
Reponse Body
GET /daily_calories Curl
Reponse Body
POST /meal Curl
Reponse Body
GET /daily_calories Curl
Reponse Body
GET /meal/day Curl
Reponse Body
Flow #2: Adding and looking up workout
POST /goals Curl
Response Body
POST /workout Curl
Response Body
GET /workout/{customer_id}/day Curl
Response Body
GET /workout/muscle_group/{type} Curl
Response Body
Flow #3: Finding workout muscle_groups
POST /goals Curl
Response Body
POST /workout Curl
Response Body
GET /workout/{customer_id}/day Curl
Response Body
GET /workout/{workout_id}/muscle_groups Curl
Response Body