EndpointsMeal Entries

Meal Entries

Function-calling namespace: mealEntries

  • 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.

create

Source: backend/endpoints/meal-entries/create

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
foodIdstringYes-
mealTypestringYes-
servingIdstringYes-
quantitynumberYes-
consumedAtintegerNounix-ms timestamp

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": "mealEntries",
  "apiName": "create",
  "data": {
    "patientId": "patient_123",
    "foodId": "food_123",
    "mealType": "general",
    "servingId": "serving_123",
    "quantity": 1
  }
}'

Example Response

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

delete

Source: backend/endpoints/meal-entries/delete

Input Fields

FieldTypeRequiredConstraints
idstringYes-
patientIdstringYes-

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": "mealEntries",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "patientId": "patient_123"
  }
}'

Example Response

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

getTodayDashboard

Source: backend/endpoints/meal-entries/get-today-dashboard

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
datestringNoformat: YYYY-MM-DD

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": "mealEntries",
  "apiName": "getTodayDashboard",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

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

getWeeklyDashboard

Source: backend/endpoints/meal-entries/get-weekly-dashboard

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
endDatestringNoformat: YYYY-MM-DD

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": "mealEntries",
  "apiName": "getWeeklyDashboard",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

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

listToday

Source: backend/endpoints/meal-entries/list-today

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
datestringNoformat: YYYY-MM-DD

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": "mealEntries",
  "apiName": "listToday",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/meal-entries/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
patientIdstringYes-
servingIdstringYes-
quantitynumberYes-

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": "mealEntries",
  "apiName": "update",
  "data": {
    "id": "id_123",
    "patientId": "patient_123",
    "servingId": "serving_123",
    "quantity": 1
  }
}'

Example Response

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