Calendar Endpoint

The calendar endpoint is the main utility of the API built-in so far. Essentially, it provides you with a stream or ical file that can be used in an Apple Calendar for notifications and the likes.

/api/calendar/{token}/{?userID}

Params

keyrequireddefault valuedatatypedescription
alertTimefalsenullIntthe amount of time before events to get alerted/get a notification in seconds. Set to null to have no notifications
shortenfalsetrueBoolboolean value to shorten the names of the subjects or not, which applies various filters to only get the useful bits
eventsfalsefalseBoolboolean that allows you to create an events calendar instead of from the user's timetable. This essentially just pulls from the events endpoint instead of the timetable endpoint.

This returns a .ical file which gets downloaded to the user's computer.

📝️

Please Note: the userID parameter is optional. Internally, if it is not provided, the API will call the userInfo endpoint for you, but if you provide it, it will just skip this section making it a bit faster for optimisation purposes.

Example

https://caulfieldsync.vercel.app/api/calendar/sampleToken?alertTime=120&shorten=true&events=false

Technicalities

This endpoint just receives the data as a JSON file and turns it into an .ical file, which can be periodically downloaded from the user using the same URL for an updated version.