Skip to main content

Endpoint

GET /diary/summary/day/:date

Authentication

This endpoint requires authentication via Bearer token.
Authorization: Bearer <token>

Path Parameters

date
string
required
Date in YYYY-MM-DD format (e.g., “2024-03-15”)

Response

success
boolean
Indicates if the request was successful
data
object
Day summary data
date
string
The requested date in YYYY-MM-DD format
mealCount
number
Total number of meal entries logged on this day
symptomCount
number
Total number of symptom entries logged on this day
worstIntensity
number
Highest symptom intensity recorded (1-5), or null if no symptoms
dayStatus
string
Overall status of the day based on symptoms. Options: great, good, okay, bad, terrible
problematicFoods
array
List of foods marked as problematic or identified as triggers
foodId
number
Food database ID
foodName
string
Name of the food
totalCalories
number
Total calories consumed (if nutritional tracking is enabled)
entries
array
Array of all entries for the day (meals and symptoms)

Examples

Get summary for a specific day

curl -X GET "https://api.ceboelha.com/diary/summary/day/2024-03-15" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get today’s summary

TODAY=$(date +%Y-%m-%d)
curl -X GET "https://api.ceboelha.com/diary/summary/day/$TODAY" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get summary for yesterday

YESTERDAY=$(date -d "yesterday" +%Y-%m-%d)
curl -X GET "https://api.ceboelha.com/diary/summary/day/$YESTERDAY" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "success": true,
  "data": {
    "date": "2024-03-15",
    "mealCount": 4,
    "symptomCount": 2,
    "worstIntensity": 3,
    "dayStatus": "okay",
    "problematicFoods": [
      {
        "foodId": 3456,
        "foodName": "Feijão preto"
      },
      {
        "foodId": 7891,
        "foodName": "Alho"
      }
    ],
    "totalCalories": 1850
  }
}

Day Status Calculation

The dayStatus field is calculated based on symptom count and intensity:
StatusCriteria
greatNo symptoms logged
good1-2 symptoms with max intensity 1-2
okay1-3 symptoms with max intensity 3
bad3+ symptoms or max intensity 4
terribleMultiple severe symptoms or max intensity 5

Use Cases

Daily Review

Use this endpoint to display a summary of the user’s day, showing how many meals were logged and whether they experienced any symptoms.

Calendar Views

When displaying a calendar, fetch day summaries to show status indicators (colored dots or icons) for each day.

Trigger Identification

The problematicFoods array helps identify which foods might have caused symptoms on a given day.

Progress Tracking

Compare day summaries over time to track improvement in symptom frequency and intensity.

Build docs developers (and LLMs) love