Appointment Booking API overview
The Appointment Booking API books and manages service appointments: check availability windows, create appointments, and read booking configuration.
Basic usage
This module hangs directly off the client root:
booking := client.AppointmentBooking()
// Check availability
availabilityRequest := appointmentbookingapi.NewAvailabilityRequest()
if err := availabilityRequest.SetCatalogID(&catalogID); err != nil {
log.Fatal(err)
}
if err := availabilityRequest.SetStartDate(&startDate); err != nil {
log.Fatal(err)
}
if err := availabilityRequest.SetEndDate(&endDate); err != nil {
log.Fatal(err)
}
availability, err := booking.Availability().Post(context.Background(), availabilityRequest, nil)
if err != nil {
log.Fatal(err)
}
// Book an appointment
appointmentRequest := appointmentbookingapi.NewAppointmentRequest()
if err := appointmentRequest.SetCatalogID(&catalogID); err != nil {
log.Fatal(err)
}
appointment, err := booking.Appointment().Post(context.Background(), appointmentRequest, nil)
if err != nil {
log.Fatal(err)
}
Available operations
- Book appointment —
Appointment().Post(ctx, body, config). - Check availability —
Availability().Post(ctx, body, config). - Calendar —
Calendar().Get(ctx, config)reads calendar data. - Configuration —
Configuration().Get(ctx, config)reads booking configuration. - Rule conditions —
ExecuteRuleConditions().Post(ctx, body, config)evaluates booking rules. - User window —
UserWindow()reads the user's booking window.