---
schema_version: "1"
id: b6705628471872bbd313641c91258c9a73766e548e87d7aab477300a7c351a8e
title: Get Service Resources
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/uc1-get-appointment-candidates.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc1-get-appointment-candidates.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 674b3a8cb2a8888d6cab62cad44401cc3db7470d37e1829c2a64c34370f19a08
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Get Service Resources

A service resource represents an employee from your organization, such as a loan officer, investment advisor, doctor, nurse practitioner, or retail store specialist, who attends appointments with clients.

1.  Create a page to show the available service resources.

2.  Make a `POST` request on the [`getAppointmentCandidates`](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/requests_ls_getappointmentcandidates.htm) REST API by passing the required `workTypeGroupId` and `territoryIds` parameters.

    **Resource URI**

    ```nolang
    https://YOUR_INSTANCE.salesforce.com/services/data/v68.0/scheduling/getAppointmentCandidates
    ```

    Where `YOUR_INSTANCE` is a variable.

    **Sample Request**

    To consider an existing user’s preferred visiting hours, pass `accountId` in the input request body. The preference is enforced when the Include Only Required Service Resources and Ignore Excluded Service Resources policy rules are enabled. For more information, see [Add Service Resource Preferences to Accounts for Salesforce Scheduler](https://help.salesforce.com/s/articleView?id=platform.ls_add_service_resource_preferences_to_accounts.htm&type=5).

    ```nolang
    
    {
      "startTime": "2023-02-15T09:00:00.000+0000",
      "endTime": "2023-02-15T19:00:00.000+0000",
      "accountId": "001S7000001pFlJIAU",
      "workTypeGroupId": "0VSS700000000sVOAQ",
      "territoryIds": [
        "0HhS700000001DYKAY"
      ],
      "engagementChannelTypeIds": [
        "0eFS70000004CG5MAM"
      ]
    }
    ```

    **Sample Response**

    The API returns the service resources available for the specified time slots.

    ```nolang
    
    {
      "candidates" : [ {
        "endTime" : "2023-02-15T18:00:00.000+0000",
        "engagementChannelTypeIds" : [ "0eFS70000004CG5MAM" ],
        "resources" : [ "0HnS700000002jAKAQ" ],
        "startTime" : "2023-02-15T17:00:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      }, {
        "endTime" : "2023-02-15T18:15:00.000+0000",
        "engagementChannelTypeIds" : [ "0eFS70000004CG5MAM" ],
        "resources" : [ "0HnS700000002jAKAQ" ],
        "startTime" : "2023-02-15T17:15:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      }, {
        "endTime" : "2023-02-15T18:30:00.000+0000",
        "engagementChannelTypeIds" : [ "0eFS70000004CG5MAM" ],
        "resources" : [ "0HnS700000002jAKAQ" ],
        "startTime" : "2023-02-15T17:30:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      }, {
        "endTime" : "2023-02-15T18:45:00.000+0000",
        "engagementChannelTypeIds" : [ "0eFS70000004CG5MAM" ],
        "resources" : [ "0HnS700000002jAKAQ" ],
        "startTime" : "2023-02-15T17:45:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      }, {
        "endTime" : "2023-02-15T19:00:00.000+0000",
        "engagementChannelTypeIds" : [ "0eFS70000004CG5MAM" ],
        "resources" : [ "0HnS700000002jAKAQ" ],
        "startTime" : "2023-02-15T18:00:00.000+0000",
        "territoryId" : "0HhS700000001DYKAY"
      } ]
    }
    ```

3.  Parse the JSON response, and show the actual service resources on a page.


Your users can select a service resource for the appointment from the page.

