Retrieve the actual service resources—an employee from your company, such as a loan officer, investment advisor, doctor, nurse practitioner, or retail store specialist who attends appointments with clients—based on the work type group and service territory that’s assigned to a service appointment. Business managers or administrators can then assign an available service resource to an appointment.
-
Make a
POSTrequest on thegetAppointmentCandidatesREST API by passing the requiredworkTypeGroupIdandterritoryIdsparameters.note: Specify the shift’s scheduling policy ID to show only the actual resources who have set regular working hours with shifts. For more information, see Configure Scheduling Policy to Enforce Shifts.
Resource URI
https://YOUR_INSTANCE.salesforce.com/services/data/v68.0/scheduling/getAppointmentCandidatesWhere
YOUR_INSTANCEis a variable.Sample Request
{ "startTime": "2022-10-01T17:00:00.000+0000", "endTime": "2022-10-08T18:00:00.000+0000", "workTypeGroupId": "0VSS70000004DvWOAU", "schedulingPolicyId": "0VrS70000004CEhKAM", "territoryIds": [ "0HhS70000004F9zKAE" ] }Sample Response
The API returns the service resources available for the specified time slots.
{ "candidates": [ { "endTime": "2022-10-01T17:30:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T17:00:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T18:00:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T17:30:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T18:30:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T18:00:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T19:00:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T18:30:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T19:30:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T19:00:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T20:00:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T19:30:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T20:30:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T20:00:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T21:00:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T20:30:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T21:30:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T21:00:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T22:00:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T21:30:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T22:30:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T22:00:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T23:00:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T22:30:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-01T23:30:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T23:00:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-02T00:00:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-01T23:30:00.000+0000", "territoryId": "0HhS70000004F9zKAE" }, { "endTime": "2022-10-02T00:30:00.000+0000", "resources": [ "0HnS700000007xwKAA" ], "startTime": "2022-10-02T00:00:00.000+0000", "territoryId": "0HhS70000004F9zKAE" } ] } -
Parse the JSON response, and show the actual service resources on a page. Business managers or administrators can select an actual resource for the appointment.