# 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.
