Newer Version Available

This content describes an older version of this product. View Latest

GetAppointmentSlotsInput Class

Contains information about the available appointment time slots for a resource based on given work type group and territories.

Namespace

LxScheduler

Usage

The constructor for this class can’t be called directly. Create an instance of this class using the GetAppointmentSlotsInputBuilder.build() method.

This example shows how to get a list of available time slots based on workTypeGroupId:

1//Build input for GetAppointmentSlots API
2   lxscheduler.GetAppointmentSlotsInput input = new lxscheduler.GetAppointmentSlotsInputBuilder()
3      .setWorkTypeGroupId('0VSxx0000004C92GAE')
4      .setTerritoryIds(new List<String>{'0Hhxx0000004C92CAE'})
5      .setStartTime(System.now().format('yyyy-MM-dd\'T\'HH:mm:ssZ'))
6      .setEndTime(System.now().addDays(1).format('yyyy-MM-dd\'T\'HH:mm:ssZ'))
7      .setAccountId('001xx000003GYK0AAO')
8      .setRequiredResourceIds(new List<String>{'0Hnxx0000004C92CAE'})
9      .setSchedulingPolicyId('0Vrxx0000004CAe')
10      .setApiVersion(Double.valueOf('48.0'))
11      .build();
12
13String response = lxscheduler.SchedulerResources.getAppointmentSlots(input);

This example shows how to get a list of available time slots based on workType:

1//Build WorkType
2   lxscheduler.WorkType workType = new lxscheduler.WorkTypeBuilder()
3      .setId('08qxx0000004C92AAE')
4      .build();
5
6   lxscheduler.GetAppointmentSlotsInput input = new lxscheduler.GetAppointmentSlotsInputBuilder()
7      .setWorkType(workType)
8      .setTerritoryIds(new List<String>{'0Hhxx0000004C92CAE'})
9      .setStartTime(System.now().format('yyyy-MM-dd\'T\'HH:mm:ssZ'))
10      .setEndTime(System.now().addDays(1).format('yyyy-MM-dd\'T\'HH:mm:ssZ'))
11      .setAccountId('001xx000003GYK0AAO')
12      .setRequiredResourceIds(new List<String>{'0Hnxx0000004C92CAE'})
13      .setSchedulingPolicyId('0Vrxx0000004CAe')
14      .setApiVersion(Double.valueOf('48.0'))
15      .build();
16
17String response = lxscheduler.SchedulerResources.getAppointmentSlots(input);

This example shows how to get a list of available time slots based on durationInMinutes and without workTypeGroupId or workType fields:

1//Build WorkType
2   lxscheduler.WorkType workType = new lxscheduler.WorkTypeBuilder()
3      .setDurationInMinutes(60)
4      .build();
5
6   lxscheduler.GetAppointmentSlotsInput input = new lxscheduler.GetAppointmentSlotsInputBuilder()
7      .setWorkType(workType)
8      .setTerritoryIds(new List<String>{'0Hhxx0000004C92CAE'})
9      .setRequiredResourceIds(new List<String>{'0Hnxx0000004C92CAE'})
10      .setApiVersion(Double.valueOf('48.0'))
11      .build();
12
13   String response = lxscheduler.SchedulerResources.getAppointmentSlots(input);

This example shows a sample response of a list of available time slots:

1[
2   {
3     "territoryId": "0Hhxx0000004C92CAE",
4     "startTime": "2021-02-10T16:00:00.000+0000",
5     "endTime": "2021-02-10T16:15:00.000+0000",
6     "remainingAppointments": 1
7   },
8   {
9     "territoryId": "0Hhxx0000004C92CAE",
10     "startTime": "2021-02-10T16:15:00.000+0000",
11     "endTime": "2021-02-10T16:30:00.000+0000",
12     "remainingAppointments": 1
13   },
14]