Get planning events
Fetch calendar events for a specific planning.This is the same endpoint as Get planning by ID, but with
events=true to include event data.Path parameters
Full planning ID with dot-separated hierarchy.Example:
enscr.cycleingenieur.1iereanneeci.elevesing1iereanneeQuery parameters
Must be
"true" to fetch events.Set to
"true" to only fetch from database backup (skip network).Useful for offline scenarios or when you know the upstream source is down.Cannot be combined with date range filtering (
from/to).Start date for filtering events (ISO 8601 format:
YYYY-MM-DD).Default: None (or 1 month ago if to is specified)Maximum range: 2 years between from and toEnd date for filtering events (ISO 8601 format:
YYYY-MM-DD).Default: None (or 2 years after from if specified)Comma-separated list of keywords to filter out events.Case-insensitive matching against event summary.Events containing any of these keywords will be excluded from results.
Set to
"true" to enable teacher highlighting.Events missing teacher information will be tagged with categoryId: "no-teacher".This feature uses heuristics specific to certain universities (IUT Nantes, IUT Vannes).
Browser/source timezone (IANA timezone name).Used with
targetTimezone for timezone conversion.Example: Europe/Paris, America/New_YorkCan also be provided via
x-timezone or x-browser-timezone headers.Target timezone for event times (IANA timezone name).Events will be converted from
browserTimezone to targetTimezone.Can also be provided via
x-target-timezone header.Response
Response fields
Planning ID (last segment)
Complete dot-separated ID
Planning display name
Timestamp (milliseconds) when events were last fetched.
- Network source: Current request time
- Database source: Last successful refresh time
- None:
null
Timestamp when database backup was last written.May differ from
refreshedAt if events haven’t changed.Overall fetch status:
"ok"- Events successfully retrieved"error"- Failed to retrieve events
Data source:
"network"- Fetched from upstream ICS URL"db"- Retrieved from database backup (network failed oronlyDb=true)"none"- No data available
Reason for error/fallback:
null- No issues"network_error"- Network fetch failed, using DB fallback"no_data"- No data available from any source"empty_schedule"- Planning has no events
Array of calendar events, or
null if no data available.Total number of events returned (after filtering)
Example requests
Network-first strategy
The API uses a network-first approach with database fallback:On success
- Parse events
- Return immediately
- Asynchronously write to database backup
- Mark refresh as successful
On failure
- Check database for backup
- Return cached events if available
- Enqueue refresh retry (for transient failures)
- Set
source: "db"andreason: "network_error"
This ensures the API remains functional even when upstream ICS sources are temporarily unavailable.
Filtering and transformations
Blocklist filtering
Events are excluded if their summary contains any blocklist keyword:Category detection
Events are automatically categorized based on heuristics:- Lecture (CM): Summary contains “CM” or “AMPHI”
- Lab (TP): Summary contains “TP” followed by optional digits
- Tutorial (TD): Summary contains “TD”
- No teacher: Missing teacher info (when
highlightTeacher=true) - Other: Default category
Location cleanup
Locations are normalized:- “salle joker à distance” → “À distance”
- “V-B101” → “B101”
- Multiple locations separated by commas
Timezone conversion
When bothbrowserTimezone and targetTimezone are provided:
- Parse event times in source timezone
- Convert to target timezone
- Return adjusted times
- Event: 10:00-12:00 in
Europe/Paris - Target:
America/New_York(UTC-5) - Result: 04:00-06:00
Date range filtering
Client-side filtering
Whenfrom and to are provided, events are filtered after parsing:
from and ending on or before to are returned.
Template URLs
Some plannings use template URLs with date placeholders:{date-start}→fromparameter (or 1 month ago){date-end}→toparameter (or 2 years ahead)
Error responses
Planning not found
404 Not Found
Invalid date range
400 Bad Request
Causes:
- Invalid date format (use
YYYY-MM-DD) - Range exceeds 2 years
fromis afterto
Range with onlyDb
400 Bad Request
Cause: Trying to use from/to with onlyDb=true. Database backups store full schedules and don’t support range filtering.
Caching and performance
Request deduplication
Concurrent requests for the same planning are coalesced into a single upstream fetch:Background refresh
WhenRUN_JOBS=true, background workers keep backups fresh:
- Backfill job: Ensures all plannings have recent backups
- Refresh worker: Retries failed fetches with exponential backoff
Use cases
- Display events in calendar
- Offline mode
- Filter by keywords
- Timezone conversion
Fetch events and render in a calendar UI:
Next steps
Plannings API
Learn how to list and retrieve plannings
Architecture
Understand the offline-first design