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

FieldTypeRequiredConstraints
stackUserIdstringYes-
namestringYes-
caloriesnumberYesmin: 0
proteinnumberNonullable
carbsnumberNonullable
fatnumberNounix-ms timestamp; nullable
fibernumberNonullable
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

FieldTypeRequiredConstraints
stackUserIdstringYes-
foodsarray<object>Yesmin: 1; dive

Nested Field Structures

foods item

FieldTypeRequiredConstraints
namestringYes-
caloriesnumberYesmin: 0
proteinnumberNonullable
carbsnumberNonullable
fatnumberNounix-ms timestamp; nullable
fibernumberNonullable
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": "addFoodsFromAI",
  "data": {
    "stackUserId": "stackuser_123",
    "foods": [
      {
        "name": "value",
        "calories": 1,
        "protein": 1,
        "carbs": 1,
        "fat": 1710201600000,
        "fiber": 1,
        "quantity": "value"
      }
    ]
  }
}'

Example Response

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

clearTodayLog

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

Input Fields

FieldTypeRequiredConstraints
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

FieldTypeRequiredConstraints
stackUserIdstringYes-
limitintegerNomin: 1; max: 365

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

FieldTypeRequiredConstraints
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

FieldTypeRequiredConstraints
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

FieldTypeRequiredConstraints
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

FieldTypeRequiredConstraints
stackUserIdstringYes-
foodIndexintegerNomin: 0

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

FieldTypeRequiredConstraints
stackUserIdstringYes-
dailyGoalnumberYesgt: 0

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": {} }