BookJob RESTified API
th
Pass Through Call to Scheduling's "Job Book Request" API
This RESTified API will perform a pass-through call to the Scheduling sub-system's "Book Job Request" API (when configured).
URL
PUT /up/v5/rest/scheduling/BookJob
HTTP Request Body
This request requires a JSON object supplied in the HTTP request body, which defines the parameters that will be passed through to the Scheduling "Book Job Request" API.
Book Job Request Object Format
Book Job Request Object Properties (bold property names indicate required field)
Property | Type | Length | Description | Req? | Field Mapping: Scheduling | |||||
---|---|---|---|---|---|---|---|---|---|---|
Id |
| SS: 50 | Caller’s identifier of the job to be booked. It must be unique in the ServiceOptimizer database, unless AllowRebook (below) is True | Yes | jobID | |||||
WorkType | object | A list of the extra Skills (skill IDs) needed to do this job, in addition to those specified in ServiceOptimizer for this job’s type. If one or more of the supplied ExtraSkills is already required by the JobType, it will be ignored unless it’s the first ExtraSkill and the ExtraSkillLevel (below) is different from that specified for the JobType. The maximum number of skills that can be supplied is 10 however, only the skillLevel for the first skillID in the list has any meaning other skills are assumed to require no specific level. | Yes | see WorkType.objects | ||||||
Location | object | Pending | Yes | see Location.objects | ||||||
vwdlLocationType | string SS: EmpLocType | SS: See Valid Values | When set, indicates that the appointment is virtual, with a dynamic location. The dynamic location to be used for the appointment is based on the assigned employee. Currently, only the SS Valid Values: "Home", "Work", "Depot", "Supplied", "None" | No | vwdlLocationType | |||||
RestrictionRef | string SS: RestrictionRef (string) | SS: 30 | Each job may optionally have a | No | restrictionRef | |||||
Flags | object | Cancel Dependency Group Jobs | No | See Flags.objects | ||||||
ExtraDuraton | string | Time (in minutes) required to complete the job in addition to what is defined in ServiceOptimizer for this job type. The maximum value which will be accepted for this field plus ExtraOverhead (below) is specified by the SJEDMax database parameter. The maximum total duration for the job is specified by the SJTDMax database parameter. Where this booking is based on offers from a previous call to OfferAppts, the values supplied in this field in this booking request must be the same as those supplied on the OfferAppts call. | No | extraDuration | ||||||
ReqProvider | array | Allows for a list of up to 10 reqEmps to be specified. | No | |||||||
ReqUnit | object | Pass through parameter to the Scheduling BookJob API. | No | see RegUnit.objects | ||||||
Priority | string SS: integer | Used to determine the cost of the job being overdue. The ABS and the optimizer will normally cost the lateness of a high priority (SLA) job higher than a low priority job. This should have the effect of making it less likely that a high priority job will be significantly overdue (late). (Lateness is the amount by which a job’s scheduled start time (or finish time in the case of call-to-fix jobs – see callToFix, below)) exceeds its time. Priority the job should have. If priority isn’t being used, it should be set to 50. Must be set between 1 and 99. | No | ? | ||||||
Importance | string SS: integer | Used to try and ensure that the jobs left in the in-tray are the less important ones and that the more important jobs are in the schedule. Must take a value between 0 and 9. Where this booking is based on offers from a previous call to OfferAppts, the values supplied in this field in this booking request must be the same as those supplied on the OfferAppts call. | No | importance | ||||||
Booking | object | Pass through parameter to the Scheduling BookJob API. | Yes | see Booking.objects | ||||||
ServHoursPreDefPatts | object | A set of Service Hours patterns that are pre-defined in ServiceOptimizer.ServHoursPreDefPatts can’t be supplied as well as ServHoursPatts (below). | No | |||||||
ServHoursPatts | array | A repeating sequence of Service Hours time periods that each apply to a day of the week. ServHoursPatts can’t be supplied as well as ServHoursPreDefPatts (above). | No | |||||||
AccHoursPatts | array | A set of Access Hours patterns for the job. The actual Access Hours for each pattern must be the same, though the | No | |||||||
BookOptions | object | Pass through parameter to the Scheduling BookJob API. | see BookOptions.objects |
HTTP Response
Success
On success, a JSON-formatted version of the Scheduling "Book Job Request" API response will be returned.
{ "Success" : true, "Code" : 0, "Message" : "OK", "Payload" : { "result" : { "type" : "OK", "code" : "0" }, "TravelTime" : "3", "WorkItems" : [ { "Id" : "Dep-1306", "Tech" : "DE3_9_01", "ETA" : "2006-01-03T08:01", "IRU" : "EMID_I01", "FRU" : "EMIDLAND" }, { "Id" : "Dep-1307", "Tech" : "DE3_9_01", "ETA" : "2006-01-03T09:02", "IRU" : "EMID_I01", "FRU" : "EMIDLAND" } ] } }
Error
On error, a JSON-formatted version of the Scheduling "Book Job Request" API response will be returned.
{ "Success": false, "Code": 9, "Payload": { "returnCode": { "type": "Error", "code": "SCH Error Code" } } }
Return Codes
In addition to the Standard Return Codes, and the Scheduling Error codes, the possible Return Codes from this API are: