---
schema_version: "1"
id: 026736401dad78766c543fbe289f2e13dbcb2f5a7187aa72e3e94b3284f7bef6
title: Change Appointment Time
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/uc4-get-appointment-slots.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc4-get-appointment-slots.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e8a0e7b6ceae67064f389bca43819e3319e6b014add0eabf3029b88317e50b30
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Change Appointment Time

A time slot represents a period in a day when an appointment can be scheduled.

1.  Create a page to show the available time slots for the resource associated with the appointment.

2.  Make a POST request on the [`getAppointmentSlots`](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/requests_ls_getappointmentslots.htm) REST API by passing the required `workTypeGroupId` or `workTypeId` parameter along with the .`territoryId` parameter.

    **Resource URI**

    ```nolang
    https://yourInstance.salesforce.com/services/data/v68.0/scheduling/getAppointmentSlots
    ```

    **Sample Request**

    Using the `WorkTypeId` parameter.

    ```nolang
    {
      "workType": {
        "id": "08qS70000004DQsIAM"
      },
      "territoryIds": [
        "0HhS700000001DYKAY"
      ],
      "requiredResourceIds": [
        "0HnS700000002jAKAQ"
      ],
      "accountId": "001S7000001pFlJIAU",
      "schedulingPolicyId": "2F0VrRM0000004CUV",
      "engagementChannelTypeIds": [
        "0eFS70000004CGFMA2"
      ]
    }
    ```

    Using the `WorkTypeGroupId` parameter.

    ```nolang
    {
      "workTypeGroupId": "0VS2x0000008ZotGAE",
      "accountId": "001S7000001pFlJIAU",
      "schedulingPolicyId": "2F0VrRM0000004CUV",
      "territoryIds": [
        "0HhS700000001DYKAY"
      ],
      "requiredResourceIds": [
        "0HnS700000002jAKAQ"
      ],
      "engagementChannelTypeIds": [
        "0eFS70000004CGFMA2"
      ]
    }
    ```

    **Sample Response**

    The API returns the available time slots for a resource.

    ```nolang
    {
      "timeSlots" : [ {
        "endTime" : "2023-03-26T17:55:00.000+0000",
        "remainingAppointments" : 1,
        "startTime" : "2023-03-26T17:30:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      }, {
        "endTime" : "2023-03-30T16:55:00.000+0000",
        "remainingAppointments" : 1,
        "startTime" : "2023-03-30T16:30:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      }, {
        "endTime" : "2023-04-02T16:55:00.000+0000",
        "remainingAppointments" : 1,
        "startTime" : "2023-04-02T16:30:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      }, {
        "endTime" : "2023-04-04T18:25:00.000+0000",
        "remainingAppointments" : 1,
        "startTime" : "2023-04-04T18:00:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      } ]
    }
    ```

3.  Parse the JSON response, and show the available time slots on the page.


Your users can select a time slot for the appointment from the page.

