Get Available Territory Slots

A time slot represents a period in a day when an appointment can be scheduled. Use the available-territory-slots Connect API to fetch the consolidated availability of each service resource within the selected territory.

  1. Create a page in your app where you can show the available time slots based on the work type group and service territory.

  2. Make a POST request on the available-territory-slots Connect API by passing the required workTypeGroupId and territoryIds parameters.

  3. Parse the JSON response, and show only the available time slots on the page. Don’t show the service resources to maintain their privacy.

    Here’s how a page showing the available time slots can look.

    A representation of the Select Service Appointment Time screen.

  4. Write custom code to randomly select a service resource for the appointment based on the time slot that the user selects. This sample code automatically selects a service resource and stores it in serviceResourceId property.

  5. Pass the list of service resources available for the selected time slot in resources.

Resource URI

For an Existing User (Account)

To consider an existing user’s preferred visiting hours, pass accountId in the input request body. The preference is enforced when the Enforce Account’s Visiting Hours policy rule is enabled.

Sample Request

Sample Response

The API returns the available time slots and service resources.

For a Guest User (Lead)

Sample Request

Sample Response

The API returns the available time slots and service resources.

On the next page in your app, you can show the appointment details for the user to review and create the appointment.