Calorie Logs
Function-calling namespace: calorieLogs
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
addFood
Source: backend/endpoints/calorie-logs/add-food
Input Fields
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
name | string | Yes |
calories | float64 | Yes |
protein | *float64 | No |
carbs | *float64 | No |
fat | *float64 | No |
fiber | *float64 | No |
quantity | string | No |
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
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
foods | []FoodInput | Yes |
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
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
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
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
limit | int | No |
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
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
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
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
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
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
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
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
foodIndex | int | No |
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
| Field | Type | Required |
|---|---|---|
stackUserId | string | Yes |
dailyGoal | float64 | Yes |
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": {} }