Calendar API
3 PracBill API endpoints for calendar. Base URL https://billing.pracbill.com.au/api.
Get the rendered calendar widget HTML for a user. Requires the per-user calendar cache file (cache/calendar_{uid}.php); without it the request fails with a server error. An invalid key returns the ErrorResponse JSON object as the body.
GET /{api_key}/calendar/getCalendar/{uid}
Responses
200— HTML calendar
Intended to return the user's calendar events as JSON, but the handler returns a PHP array instead of a string, which Tonic's Response::create() treats as a [code, body] pair. With events from exactly one module the body is the literal text `Array` (HTTP 200); with events from none or from several modules the response is HTTP 204 with an empty body. Requires the per-user calendar cache file (cache/calendar_{uid}.php); without it the request fails with a server error. An invalid or unknown API key returns HTTP 200 with the `ErrorResponse` envelope `{"success": false, "description": "invalid key"}`; the handler's other failures use the same envelope with a different `description`.
GET /{api_key}/calendar/getEvents/{uid}
Responses
200— Body is the literal string `Array` (a single module produced events), or the ErrorResponse envelope for an invalid key204— No events, or events from more than one module (empty body)
Get the user's calendar events as an iCalendar (.ics) feed (VEVENTs lasting 10 minutes; served with `Content-Disposition: attachment; filename=calendar.ics`). Calendar and PRODID names come from the white-label layer. Requires the per-user calendar cache file (cache/calendar_{uid}.php); without it the request fails with a server error. An invalid key returns the ErrorResponse JSON object as the body.
GET /{api_key}/calendar/getEventsUrl/{uid}
Responses
200— iCalendar file