Calendar V3: Sample Use Cases and Flows

This article shares possible use cases you could support, along with sample flows that could guide each use case. Use this as a starting point as you plan your implementation.

Manage a calendar

Allow business owners to manage schedules.

To manage a calendar:

  1. Call Create Schedule to set your new calendar. Specify your appId, we recommend to also set name. Save the ID of the created schedule.
  2. Call Create Event for every event you want to add to the calendar. Specify the scheduleId, start, and end times.
  3. To display the calendar to the business owner, call Query Events, filtering by your appId.
  4. When the calendar owner clicks on an event, you could display more details and allow editing and canceling the event.
  5. Optional: Call Update Event and Cancel Event as necessary.

Sync calendars to an external system

You can help business owners keep their external calendar up to date with their Wix calendars.

To synchronize to the external system:

  1. Subscribe to the Events View Projection Updated event.
  2. Based on the domain event's actionEvent type, create, update, or delete the corresponding event in the external calendar:
    • eventAddedOrUpdated: Create or update the event in the external calendar if its revision is higher than that of the event stored in the external calendar.
    • eventRemoved: Soft delete the event in the external calendar to avoid inconsistencies, as a hard delete might cause a mismatch if an updated event arrives later than a delete event.
  3. Call Get Events View to retrieve the endDate of the Wix calendar's event view.
  4. Call Query Events to retrieve information about all events in the current event view.
    • Specify the endDate value from the event view as toLocalDate.
    • You may specify fromLocalDate as needed.
    • You can specify additional query filters based on your use case. See the filtering article for a complete list of supported filters.
  5. Continue listening to the Events View Projection Updated event. Create, update, or soft delete events in the external calendar as described in step 2.

Create a participant dashboard

Enable business owners to manage their events' participation details through a dashboard. Note that Wix Bookings automatically provides this functionality.

To create a participant dashboard:

  1. Call Query Events, specifying fromLocalDate and toLocalDate as filters. For additional filter options, refer to the filtering article.
  2. Display the events to the business owner and let them select an event for participation management.
  3. Call Query Participations, specifying the event ID as filter.
  4. Display the participant list to the business owner, enabling them to modify it as needed.
  5. Call Create Participation, Update Participation, or Delete Participation to adjust the list as necessary.

Block Wix Bookings resources

You could extend Wix Bookings functionality by blocking time across multiple Bookings resources.

To block Bookings resources:

  1. Call Query Resources to retrieve the schedule IDs of the relevant resources.
  2. Set up a combined schedule for all affected resources by calling Create Schedule. Specify a descriptive name and set appId to the Wix Bookings app ID 13d21c63-b5ec-5912-8397-c3a5ddb27a97. Save the returned scheduleId.
  3. Call Create Event. Specify a start and end time, the scheduleId, and all relevant resourceIds. To make the blocked time recurring, also specify a recurrenceRule.

Integrate Google Meet with Wix Bookings appointments

You can add Google Meet conferencing to Wix Bookings appointments. By default, Wix Bookings supports only Zoom conferencing.

To integrate Google Meet with Wix Bookings appointments:

  1. For the relevant appointment-based service, call Update Service to set conferencing.enabled to false. This prevents Wix Bookings from automatically adding default conferencing details to the service.
  2. Subscribe to Events View Projection Updated.
  3. Filter events to identify those for the relevant service:
    • Ensure actionEvent.body.appId equals the Wix Bookings app ID 13d21c63-b5ec-5912-8397-c3a5ddb27a97.
    • Check that event.externalScheduleId equals your target service ID.
  4. Based on the domain event's actionEvent type, create, update, or delete the corresponding Google Meet meeting:
    • eventAddedOrUpdated:
      1. Check if the event already includes Google Meet conferencing.
      2. If conferencing is missing, create a Google Meet meeting using Google's APIs.
      3. If the event already has conferencing, update the Google Meet meeting using Google's APIs. For example, when participants are added or removed or when the meeting is rescheduled.
      4. Call Update Event to add or update the Google Meet conferencing details for the calendar event. Specify the event id, revision, and conferencingDetails with type set to CUSTOM, along with the meeting URLs in hostUrl and guestUrl. Optionally, you can also set conferencingDetails.externalId for your own management purposes.
    • eventRemoved: Delete the corresponding Google Meet meeting using Google's APIs.
Did this help?