Get Available Resources

Retrieve the resources that are available for an anonymous appointment.

A service resource represents an employee from your organization, such as a loan officer, investment adviser, doctor, nurse practitioner, or retail store specialist, who attends appointments with clients. This task explains how to retrieve service resources that match various criteria such as work type group, territory, start time, and end time from the selected service appointment. Use the getAppointmentCandidates REST API to fetch the available service resources based on work type group and service territory.

Make a POST request on the getAppointmentCandidates REST API by passing the required workTypeGroupId, territoryIds, startTime, and endTime parameters.

Use this URI for the request:

1https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/scheduling/getAppointmentCandidates

Where YOUR_INSTANCE is a variable.

Use this request body with the POST request:

1{
2   "startTime" : START_TIME,
3   "endTime" : END_TIME,
4   "territoryIds" : [TERRITORY_IDS]
5   "workType" : 
6       {
7           "id": WORK_TYPE_ID       }
8}

Where START_TIME, END_TIME, TERRITORY_IDS, and WORK_TYPE_ID are variables.

This code snippet is an example request body:

1{
2    "startTime" : "2021-10-25T17:30:00.000+0000",
3    "accountId" : "001B000001McLhMIAV",
4    "territoryIds" : ["0HhB0000000TaHOKA0"],
5    "workType" : 
6        {
7            "id": "08qB0000000UF63IAG"
8        }
9    
10 }

The request returns a list of anonymous resources that match the criteria specified in the request body.

1{
2  "candidates": [
3    {
4      "endTime" : "2021-10-25T18:30:00.000+0000",
5      "resources" : [ "0HnB0000000TavDKAS" ],
6      "startTime" : "2021-10-25T17:30:00.000+0000",
7      "territoryId" : "0HhB0000000TaHOKA0"
8    }, {
9      "endTime" : "2021-10-25T19:00:00.000+0000",
10      "resources" : [ "0HnB0000000TavDKAS" ],
11      "startTime" : "2021-10-25T18:00:00.000+0000",
12      "territoryId" : "0HhB0000000TaHOKA0"
13    }, {
14      "endTime" : "2021-10-25T19:30:00.000+0000",
15      "resources" : [ "0HnB0000000TavDKAS" ],
16      "startTime" : "2021-10-25T18:30:00.000+0000",
17      "territoryId" : "0HhB0000000TaHOKA0"
18    }, {
19      "endTime" : "2021-10-25T20:00:00.000+0000",
20      "resources" : [ "0HnB0000000TavDKAS" ],
21      "startTime" : "2021-10-25T19:00:00.000+0000",
22      "territoryId" : "0HhB0000000TaHOKA0"
23    }  ]
24}