window.sharepaTermine
Interface for bookings in the browser. sharepa adds it to every page whose code uses it. It only talks to /__sharepa/termine at the page's own address, never directly to Google.
Readiness#
The script may load after your code. First check whether window.sharepaTermine exists, otherwise wait for the event sharepaTermine on document.
If the interface is still missing after 5 seconds, show "Bookings are not set up for this page yet."
function ready(fn) {
if (window.sharepaTermine) fn();
else document.addEventListener("sharepaTermine", fn, { once: true });
}typen()#
sharepaTermine.typen()
Returns the booking types of this page.
Return value#
- types[].idTextShort name, for example
erstgespraech. - types[].nameTextDisplay name.
- types[].descriptionText or null
- types[].durationMinutes
- types[].locationsList
meet,telefon,vorortorlink. - timezoneTextYour time zone, such as
Europe/Zurich.
{
"types": [{
"id": "erstgespraech",
"name": "First call",
"description": null,
"duration": 20,
"locations": ["meet"]
}],
"timezone": "Europe/Zurich"
}zeiten()#
sharepaTermine.zeiten(type, from, to)
Returns free start times in UTC. Takes your calendar, buffers, notice and daily limits into account.
Parameters#
- typeTextRequiredShort name of the type.
- fromYYYY-MM-DDRequiredFirst day, in your time zone.
- toYYYY-MM-DDRequiredLast day, included. At most 31 days after
from.
const { slots } = await sharepaTermine.zeiten(
"erstgespraech", "2026-11-23", "2026-12-04"
);
// ["2026-11-23T08:00:00Z", "2026-11-23T08:30:00Z", …]buchen()#
sharepaTermine.buchen(details)
Books a time and returns { start, end } in UTC. A short security check from sharepa appears first; you do not build anything for it.
Parameters#
- typeTextRequired
- startTextRequiredExactly one value from
slots. - nameTextRequired
- emailTextRequired
- locationTextRequiredOne of the type's
locations. - phoneTextOnly with
location: "telefon". - answersObjectThe page's own questions, flat, field names in lowercase and without a leading underscore.
try {
await sharepaTermine.buchen({
type: "erstgespraech",
start: "2026-11-23T08:00:00Z",
location: "meet",
name: "Anna Muster",
email: "anna@example.com",
answers: { topic: "Website for my practice" },
});
} catch (e) {
if (e.code === "termine.belegt") reloadTimes();
}Error codes#
Errors are Error objects with the fields code and status.
| Code | Status | Meaning | What the page should do |
|---|---|---|---|
termine.aus | 404 | The page has no active booking type. | "Bookings are not set up for this page yet." |
termine.belegt | 409 | The time was just taken. | Reload the times. |
termine.turnstile | 403 | The security check failed. | Let the visitor try again. |
formular.heikel | 422 | Answers look like password, payment or health data. | Point this out. |
termine.ungueltig | 400 | Details are missing or wrong, such as a time that does not exist. | General error message. |
termine.langsam | 429 | Too many requests or bookings in a short time. | Let the visitor try again later. |
formular.grenze | 429 | The entry limit is reached. | General error message. |
termine.gesperrt | 401 | The page has a password, and the visitor has not unlocked it. | General error message. |
termine.nicht_verfuegbar | 503 | Bookings are not possible right now, for example because the calendar is disconnected. | General error message. |
termine.fehler | 502 | Unexpected error. | General error message. |
Last updated