Cubu Docs
Technical Guide
Technical Guide
  • Welcome to Cubu's Technical Guide!
  • White Papers
    • Data Protection
    • Sign On and Authentication
  • Advanced Configuration
    • Configuring Video Meetings
      • ⚒️Using Microsoft Teams for Video Meetings
      • ⚒️Using Zoom for Online Meetings
    • Calendar Integration
      • ⚒️Configuring Microsoft Office 365 Calendar Integration
      • ⚒️Configuring Google Workspace Calendar Integration
    • Configuring Single Sign On (SSO)
      • ⚒️Configuring SSO with Azure AD
      • ⚒️Configuring SSO with Okta
      • ⚒️Configuring SSO with Auth0
    • Configuring Chatbots
      • Configure Chatbot using WhatsApp
  • Webhooks
    • Webhooks Configuration
    • Developing Webhooks
      • Dev Tools
      • HMAC Validation (ASP.NET Core)
    • Webhooks Reference
      • Organization Webhooks
        • 🪝Webhook: Send SMS
      • Data Table Webhooks
        • 🪝Webhook: Query
        • 🪝Webhook: Find
        • 🪝Webhook: Fetch
      • Service Webhooks
        • 🪝After Book Appointment
        • 🪝After Check In
        • 🪝After Close
        • 🪝Before Book Appointment
        • 🪝Before Check In
        • 🪝Before Queue-Up
        • 🪝Before Resolve
        • 🪝After Queue-up
        • 🪝After Resolve
        • 🪝After Start Work
      • Kiosk Webhooks
        • 🪝Before Query Appointments
  • Server to Server (S2S) API
    • Server to Server (S2S) API
Powered by GitBook
On this page
  • Overview
  • API
  • URL
  • Request Body
  • Response Body
  1. Webhooks
  2. Webhooks Reference
  3. Service Webhooks

Before Book Appointment

Run custom code before booking an appointment.

Overview

Triggered when booking an appointment before the case is created and added to the calendar.

You can use this webhook to perform the following tasks:

  • Modify the case fields and tags.

  • Set the case’s customer.

  • Change the case’s service type.

  • Change the case’s channel.

  • Cancel the operation.

API

URL

[base-url]/service/actions/beforeBookAppointment

Request Body

The webhook receives the following input:

  • caseId: The case ID to be created.

  • parentCaseId: The parent case ID (when applicable).

  • referenceDate: The case’s reference date.

  • unitId: The ID of the service’s parent unit.

  • serviceId: The service used to create the case.

  • serviceCategoryId: Service category ID.

  • serviceTypeId: Service type ID.

  • status: The case’s target status (Pending/Waiting).

  • channel: Communication channel (Face-to-face, Video, etc.).

  • language: The preferred communication language.

  • ticket: The ticket number

    • prefix

    • number

    • suffix

  • fields: A Dictionary of fieldTypeId + fieldValue pairs.

  • tagIds: An array of tag IDs.

  • customerRecordId: The ID of the customer record linked to the case.

  • triggeredByUserId: The ID of the user who triggered this action (when applicable). The value is null when a Kiosk or the S2S API triggers the operation.

  • triggeredByUserEmail: The email address of the user who initiated the action, if applicable.

  • appointment

    • date: The appointment date

    • cuIndex: The calendar index (“Capacity Unit Index”)

    • start: The appointment start time, represented as the number of minutes past midnight.

    • timeLocal: The appointment’s date and time in the service’s time zone.

    • timeUtc: The appointment’s date and time in the UTC time zone.

    • timeZoneId: The appointment’s service time zone.

    • duration: The appointment duration (in minutes).

    • preventSelfCheckIn: A boolean value indicating whether the customer can check in to this appointment using the kiosk.

Response Body

The webhook returns the following data:

  • fields (optional): A Dictionary of fieldTypeId + fieldValue pairs. Allows setting the case field. Return null to keep current field values. Important! The fields returned from the webhook replace the existing case fields. Make sure to return all the fields you want to keep in the case record. Return null to keep the original fields.

  • tagIds (optional): An array of tag IDs. The parameter must include only tags defined within the associated service category. Return null to keep the original tags.

  • removeCustomer (boolean): when True, the case's customer is removed (if applicable).

  • customerRecordId (optional): The ID of the customer record to link to the case. When the webhook returns null, the original customer remains unchanged (unless removeCustomer is true). Return null to keep the original value.

  • useCustomerContactInfo (bool): Indicates whether to use the customer's contact information for this case.

  • contactPhoneNumber: The contact phone number for this case record. Leave null to keep the current phone number (must be null when the useCustomerContactInfo parameter is true).

  • contactEmail: The contact email for this case record. Leave null to keep the current email (must be null when the useCustomerContactInfo parameter is true).

  • serviceTypeId (optional): Sets the case’s service type. The service type must belong to the case’s service category. Return null to keep the original value. Important! Changing the service type does not change the original appointment duration.

  • channel (optional): The case’s communication channel. The case’s service type must support the channel. Return null to keep the original value.

  • preventSelfCheckIn (optional): A boolean value indicating whether the customer can check in to this appointment using the kiosk. Return null to keep the original value.

  • cancelled (boolean): return true to cancel the operation.

  • cancellationReason (text): The reason for the cancellation. The text will be displayed on the Create Case dialog.

You can use this webhook to set the case’s contact phone number and contact email by returning the corresponding fields in the fields array.

PreviousAfter CloseNextBefore Check In

Last updated 7 months ago

🪝