EndpointsCalorie Logs

Calorie Logs

Function-calling namespace: calorieLogs

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

addFood

Source: backend/endpoints/calorie-logs/add-food

Input Fields

FieldTypeRequired
stackUserIdstringYes
namestringYes
caloriesfloat64Yes
protein*float64No
carbs*float64No
fat*float64No
fiber*float64No
quantitystringNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "addFood",
  "data": {
    "stackUserId": "stackuser_123",
    "name": "value",
    "calories": 1
  }
}'

Example Response

{ "status": "ok", "data": {} }

addFoodsFromAI

Source: backend/endpoints/calorie-logs/add-foods-from-ai

Input Fields

FieldTypeRequired
stackUserIdstringYes
foods[]FoodInputYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "addFoodsFromAI",
  "data": {
    "stackUserId": "stackuser_123",
    "foods": []
  }
}'

Example Response

{ "status": "ok", "data": {} }

clearTodayLog

Source: backend/endpoints/calorie-logs/clear-today-log

Input Fields

FieldTypeRequired
stackUserIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "clearTodayLog",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getCalorieHistory

Source: backend/endpoints/calorie-logs/get-calorie-history

Input Fields

FieldTypeRequired
stackUserIdstringYes
limitintNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "getCalorieHistory",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getCalorieSummary

Source: backend/endpoints/calorie-logs/get-calorie-summary

Input Fields

FieldTypeRequired
stackUserIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "getCalorieSummary",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getTodayLog

Source: backend/endpoints/calorie-logs/get-today-log

Input Fields

FieldTypeRequired
stackUserIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "getTodayLog",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getWeeklyCalorieStats

Source: backend/endpoints/calorie-logs/get-weekly-calorie-stats

Input Fields

FieldTypeRequired
stackUserIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "getWeeklyCalorieStats",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

removeFood

Source: backend/endpoints/calorie-logs/remove-food

Input Fields

FieldTypeRequired
stackUserIdstringYes
foodIndexintNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "removeFood",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

updateDailyGoal

Source: backend/endpoints/calorie-logs/update-daily-goal

Input Fields

FieldTypeRequired
stackUserIdstringYes
dailyGoalfloat64Yes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "calorieLogs",
  "apiName": "updateDailyGoal",
  "data": {
    "stackUserId": "stackuser_123",
    "dailyGoal": 1
  }
}'

Example Response

{ "status": "ok", "data": {} }