Newer Version Available
GetAppointmentCandidatesInput Class
Contains information about the available service resources
(appointment candidates) based on work type group and service territories.
Namespace
Usage
The constructor for this class can’t be called directly. Create an instance of this class using the GetAppointmentCandidatesInputBuilder.build() method.
This example shows how to get a list of available appointment candidates based on workTypeGroupId:
1//Build input for GetAppointmentCandidates API
2 lxscheduler.GetAppointmentCandidatesInput input = new lxscheduler.GetAppointmentCandidatesInputBuilder()
3 .setWorkTypeGroupId('0VSRM0000000ABc4AM')
4 .setTerritoryIds(new List<String>{'0HhRM0000000FXd0AM'})
5 .setStartTime(System.now().format('yyyy-MM-dd\'T\'HH:mm:ssZ','America/New_York'))
6 .setEndTime(System.now().addDays(5).format('yyyy-MM-dd\'T\'HH:mm:ssZ','America/New_York'))
7 .setAccountId('001RM0000053iQgYAI')
8 .setSchedulingPolicyId('0VrRM00000000Bx')
9 .setApiVersion(Double.valueOf('50.0'))
10 .build();
11
12 String response = lxscheduler.SchedulerResources.getAppointmentCandidates(input);This example shows how to get a list of available appointment candidates based on workType:
1//Build WorkType
2 lxscheduler.WorkType workType = new lxscheduler.WorkTypeBuilder()
3 .setId('08qRM0000000G9RYAU')
4 .build();
5
6 lxscheduler.GetAppointmentCandidatesInput input = new lxscheduler.GetAppointmentCandidatesInputBuilder()
7 .setWorkType(workType)
8 .setTerritoryIds(new List<String>{'0HhRM0000000FXd0AM'})
9 .setStartTime(System.now().format('yyyy-MM-dd\'T\'HH:mm:ssZ','America/New_York'))
10 .setEndTime(System.now().addDays(5).format('yyyy-MM-dd\'T\'HH:mm:ssZ','America/New_York'))
11 .setAccountId('001RM0000053iQgYAI')
12 .setSchedulingPolicyId('0VrRM00000000Bx')
13 .setApiVersion(Double.valueOf('50.0'))
14 .build();
15
16 String response = lxscheduler.SchedulerResources.getAppointmentCandidates(input);This example shows how to get a list of available candidate appointments based on durationInMinutes and without the workTypeGroupId or workType fields:
1//Build SkillRequirement
2 lxscheduler.SkillRequirement skillReq = new lxscheduler.SkillRequirementBuilder()
3 .setSkillId('0C5RM0000004EZS0A2')
4 .setSkillLevel(90)
5 .build();
6
7//Build WorkType
8 lxscheduler.WorkType workType = new lxscheduler.WorkTypeBuilder()
9 .setDurationInMinutes(15)
10 .setBlockTimeBeforeAppointmentInMinutes(5)
11 .setBlockTimeAfterAppointmentInMinutes(5)
12 .setTimeFrameStartInMinutes(10080)
13 .setTimeFrameEndInMinutes(40320)
14 .setOperatingHoursId('0OHRM0000000FmG4AU')
15 .setSkillRequirements(new List<lxscheduler.SkillRequirement>{skillReq})
16 .build();
17
18 lxscheduler.GetAppointmentCandidatesInput input = new lxscheduler.GetAppointmentCandidatesInputBuilder()
19 .setWorkType(workType)
20 .setTerritoryIds(new List<String>{'0HhRM0000000FXd0AM'})
21 .setSchedulingPolicyId('0VrRM00000000Bx')
22 .setApiVersion(Double.valueOf('50.0'))
23 .build();
24
25 String response = lxscheduler.SchedulerResources.getAppointmentCandidates(input);This example shows a sample response of a list of available candidates:
1[
2 {
3 "startTime": "2021-02-16T16:15:00.000+0000",
4 "endTime": "2021-02-16T16:16:00.000+0000",
5 "resources": [
6 "0Hnxx0000004C9BCAU"
7 ],
8 "territoryId": "0Hhxx0000004C92CAE"
9 },
10 {
11 "startTime": "2021-02-16T16:30:00.000+0000",
12 "endTime": "2021-02-16T16:31:00.000+0000",
13 "resources": [
14 "0Hnxx0000004C9BCAU"
15 ],
16 "territoryId": "0Hhxx0000004C92CAE"
17 },
18]