---
schema_version: "1"
id: eaa8ca1cdb8a265e4229c6b9c3b6331198e240d681cbcdb382bc79c470bd14e3
title: Get Appointment Time Slots
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/salesforce-scheduler-dev-guide/guides/salesforce-scheduler/uc3-get-appointment-slots.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc3-get-appointment-slots.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b929e9fcb58b2e1153a0aedf13eb0caa33f9cd954dcba7f544809d02b9f11774
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Get Appointment Time Slots

A time slot represents a period in a day when an appointment can be scheduled. Use the `getAppointmentSlots` REST API to fetch the available time slots for a resource.

1.  Create a page in your app to show the selected primary resource, other required resources, including assets, and the consolidated time slots for the primary service resource and required resources that users select.

    Here’s how a page can look.

    ![A representation of the manage multiple service resource screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/screen_manage_multi_resources.png)

2.  When the user selects one or more required resources, refresh the available time slots by making a POST request to the [getAppointmentSlots](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/requests_ls_getappointmentslots.htm) REST API and passing the selected required resources along with the `workTypeGroupId` and `territoryId` parameters.

    **Resource URI**

    ```nolang
    https://yourInstance.salesforce.com/services/data/vXX.X/scheduling/getAppointmentSlots
    ```

    **Sample Request**

    ```nolang
    {
       "startTime" : "2023-11-30T09:00:00.000+0000",
       "endTime" : "2023-12-01T23:30:00.000+0000",
       "accountId" : "001S7000001pFlJIAU",
       "workTypeGroupId" : "0VSS700000000sVOAQ",
       "territoryIds" : ["0HhS700000001DYKAY"],
       "engagementChannelTypeIds": [
        "0eFS70000004CG5MAM"
       ],
       "primaryResourceId" : "0HnS700000002jAKAQ",
       "requiredResourceIds" : ["0HnS700000002jKKAQ"]
    }
    ```

    **Sample Response**

    The API returns the time slots where the selected primary resource and required resources are available for the multi-resource appointment.

    ```nolang
    {
      "timeSlots": [
        {
          "endTime": "2023-11-30T18:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-11-30T17:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        },
        {
          "endTime": "2023-11-30T19:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-11-30T18:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        },
        {
          "endTime": "2023-11-30T20:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-11-30T19:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        },
        {
          "endTime": "2023-11-30T21:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-11-30T20:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        },
        {
          "endTime": "2023-11-30T22:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-11-30T21:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        },
        {
          "endTime": "2023-11-30T23:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-11-30T22:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        },
        {
          "endTime": "2023-12-01T00:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-11-30T23:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        },
        {
          "endTime": "2023-12-01T01:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-12-01T00:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        },
        {
          "endTime": "2023-12-01T02:00:00.000+0000",
          "engagementChannelTypeIds": [
            "0eFS70000004CG5MAM"
          ],
          "remainingAppointments": 1,
          "startTime": "2023-12-01T01:00:00.000+0000",
          "territoryId": "0HhS700000001DYKAY"
        }
      ]
    }
    ```

3.  Parse the JSON response, and show the available time slots for the selected resources.

    Here’s how a Select Service Appointment Time page can look.

    ![A representation of the selected required resources screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/screen_selected_requied_resources.png)

    **note:** A multi-resource appointment can have a maximum of five required service resources: one primary required service resource plus four required service resources, including asset resources.


On the next page in your app, you can show the appointment details for the user to review and create the appointment.

