Slot Response API
The response to the Propose Times request API is scheduling slots for the work order, only if the data passed is correct. If the data is incorrect or there is a mismatch, the request returns an error file as response, which contains the reason for failure.
Success Scenario
In the success scenario, the API returns response JSON which contains suitable slots for the work order.
Sample Response JSON
The following is an example response JSON file.
{
"jobInstanceId": 9910,
"proposedSlotElement": {
"id": "WO-1",
"resolvedLatitude": 50.849983,
"resolvedLongitude": -1.070081,
"slots": [
{
"resource": "Technician-1",
"startTime": "2020-06-12T07:00:00Z",
"driveDuration": "PT1H33M11.514S",
"arrivalTime": "2020-06-12T08:33:11.514Z",
"idleDuration": "PT0S",
"serviceDuration": "PT2H",
"endTime": "2020-06-12T10:33:11.514Z",
"category": "RECOMMENDED"

},
{
"resource": "Technician-1",
"startTime": "2020-06-13T07:00:00Z",
"driveDuration": "PT1H33M11.514S",
"arrivalTime": "2020-06-13T08:33:11.514Z",
"idleDuration": "PT0S",
"serviceDuration": "PT2H",
"endTime": "2020-06-13T10:33:11.514Z",
"category": "OK"

},
{
"resource": "Technician-3",
"startTime": "2020-06-12T07:00:00Z",
"driveDuration": "PT3H46M37.412S",
"arrivalTime": "2020-06-12T10:46:37.412Z",
"idleDuration": "PT0S",
"serviceDuration": "PT2H",
"endTime": "2020-06-12T12:46:37.412Z",
"category": "POOR"

},
{
"resource": "Technician-3",
"startTime": "2020-06-13T07:00:00Z",
"driveDuration": "PT3H46M37.412S",
"arrivalTime": "2020-06-13T10:46:37.412Z",
"idleDuration": "PT0S",
"serviceDuration": "PT2H",
"endTime": "2020-06-13T12:46:37.412Z",
"category": "POOR"

},
{
"resource": "Technician-3",
"startTime": "2020-06-14T07:00:00Z",
"driveDuration": "PT3H46M37.412S",
"arrivalTime": "2020-06-14T10:46:37.412Z",
"idleDuration": "PT0S",
"serviceDuration": "PT2H",
"endTime": "2020-06-14T12:46:37.412Z",
"category": "POOR"

}

]

},
"exceptionMsgCode": 0,
"createdDateTime": "2020-06-11T12:05:20.678Z"
}
Field Descriptions
The following table describes the fields in the Slot Response JSON. See the sample response JSON file for examples.
Element Type
Field
Description
jobInstanceId
This is the j
ob reference ID.
proposedSlotElement
id
This is the w
ork order ID.
resolvedLatitude
This is the l
atitude coordinate of the work order location.
resolvedLongitude
This is the l
ongitude coordinate of the work order location.
slots
This is the available slot information for the work order.
The following information is provided for each available slot:
resource: Name of the technician.
startTime: Start time of the drive to reach the work order location.
driveDuration: Driving time needed for this slot from the technician's current location.
arrivalTime: Technician arrival time for this work order.
idleDuration: Technician idle time, if any. If the technician arrival time is earlier than the start time for the slot, there is idle time.
serviceDuration: Service duration
for the work order.
endTime: End time of the slot for the work order.
category: Category of the slot. Possible values are RECOMMENDED, OK, and POOR.
exceptionMsgCode
This is the m
essage code for the exception message. In the success scenario, the message code is always 0.
createdDateTime
This is the d
ate and time at which the response JSON was created.
Failure Scenario
In the failure scenario, a validation error file is returned. It means that the optimizer rejects the Propose Times input and does not run the job.
Sample Response JSON
The following is an example error response JSON file.
{
"jobInstanceId":10757,
"proposedSlotElement": {
"id":"WorkOrder-1"
},
"violations": [
{"code":-120,
"message":"Hard constraint is violated"
}
],
"exceptionMsg":"Failed to get appointment offers",
"exceptionMsgCode":-7,
"createdDateTime":"2021-09-29T07:23:35.971Z"
}
Field Descriptions
The following table describes the fields in the error validation JSON. See the sample response JSON file for examples.
Field
Description
Notes
jobInstanceId
This is the j
ob reference ID.
proposedSlotElement
This is the Work Order ID.
violations
The list of violations due to which no proposals or slots are found for work order.
code – Violation code
message – Violation message corresponding to code
exceptionMsg
This is the e
rror message that indicates the reason for which scheduling was not performed for the work order.
For the list of error codes and corresponding error messages, see Error Codes and Messages.
exceptionMsgCode
This is the e
rror message code.
createdDateTime
This is the d
ate and time when the response JSON was created.
Error Codes and Messages
For the list of error codes and messages, see Error Codes and Messages.
Was this helpful?