bookAppointmentRequest
Endpoint
The endpoint for this API is https://<hostname>:<port>/optimax/eco/v2/schedule-services/bookAppointment.
Description
This API request is sent when a slot is selected for appointment booking.
Example
The following is an example bookAppointmentRequest JSON file.
{
"dispatchProcessId": "a18g0000008M1icAAC",
"territoryId": "a1jg000000226nIAAQ",
"orgId": "00Dg0000006Qv56",
"workOrder": {
"workOrderType":"NEW",
"workOrderId":"WO-00008580",
"visitDuration":3600.0,
"serviceTimes": [
{
"workingHoursEnd":"2028-09-12T09:30:00.000Z",
"workingHoursBegin":"2028-09-12T07:00:00.000Z"

}

],
"scheduleViolationPenalty":1000.0,
"requiredProduct":null,
"requiredExpertise":null,
"qualifiedTechnicians": [

],
"priority":5.0,
"preferredResourcePriority":5.0,
"preferredResourceId":"null_null",
"operationType":"update",
"mandatoryTechnicians": [

],
"location": {
"longitude":77.596878,
"latitude":12.971755

},
"importance":5,
"bannedTechnicians": [

],
"address":"1401 BANK ST, CINCINNATI, OH, 45214"

},
"slotCost": "3000.0",
"goAhead": "true"
}
Input Description
The following table describes the fields in the bookAppointmentRequest JSON.
Input Type
Field
Mandatory or Optional?
Description
Notes
dispatchProcessId
Mandatory
This is the dispatch process ID.
territoryId
Mandatory
This is the territory ID.
orgId
Mandatory
This is the Salesforce org ID.
workOrder
workOrderType
Mandatory
This is the type of the work order.
workOrderId
Mandatory
This is the work order number.
visitDuration
Mandatory
This is the service duration for the work order in seconds.
serviceTimes
Mandatory
These are the working hours for the work order.
These values must be provided in the pairs of workingHoursEnd and workingHoursBegin field values.
scheduleViolationPenalty
Optional
This is the penalty that is applied for violating a scheduled time for a work order.
requiredProduct
Optional
This is the product serviced for the work order.
requiredExpertise
Optional
This is the required skill for the work order.
qualifiedTechnicians
Optional
This is the list of qualified technicians for the work order.
priority
Mandatory
This is the dispatch process priority.
preferredResourcePriority
Optional
This is the preferred technician priority, if any.
preferredResourceId
Optional
This is the preferred technician ID.
operationType
Mandatory
This is the type of the operation.
In this case, operation type is Update, as we are updating a record.
Options are Add, Update, and Remove.
mandatoryTechnicians
Optional
This is the ID of the Mandatory technician, if any, amongst the qualified technicians.
location
Mandatory
This is the location of the work order, in latitude-longitude pair values.
Either location or address values are mandatory. If one is present, then the other is optional.
importance
Mandatory
This field must be set to the same value as Priority.
bannedTechnicians
Optional
This is the list of banned technicians, if any, amongst qualified technicians.
address
Optional
This is the address of the work order.
Either location or address values are mandatory. If one is present, then the other is optional.
slotCost
Optional
This is the cost attached with the selected slot.
goAhead
This is the value of the confirmation message response.
Possible values are True and False.
Was this helpful?