OS1 Services
...
Dispatch Service
Integrate with Dispatch

How to: Manage Jobs

11min
for information about prerequisites, see integrate with dispatch docid 3jkkjjw3r0n1l32h lbgo create job attributes to create job attributes, call the post attribute config for job docid\ wj8xio0jour7zt8u 0rdr endpoint and pass the following required members in the request body member description remarks attributes > name name of the attribute string minlength 1 maxlength 32pattern ^\[a za z]{1,32}$ attributes > datatype data type of the attribute string enum \[ string, number, boolean, object, array ] attributes > validation > range > min & max field to specify the range that the attribute value must lie in the case of the "string" datatype, the range will be the length of a string value this validation allowed only for string and number type of attributes number also, specify the jobtypeid in the path parameter the json request body should be similar to the following { "attributes" \[ { "name" "pickup", "description" "pickup job", "tags" \[ "pick" ], "datatype" "string", "indexed" false, "defaultvalue" {}, "validation" { "range" { "min" 0, "max" 0 }, "regex" "string", "valueoneof" \[ "string" ], "required" false } } ], " event meta" {} } retrieve job attributes to retrieve job attributes, call the get attribute config of a job type docid 9ay 9fzfyydsgicwsloru endpoint and specify the jobtypeid in the path parameter create a job to create a job, call the create a new job docid\ z2ujp1bpq9p5dht2ojycd endpoint and pass the following required members in the request body member description remarks jobworkflowid id of the job workflow string min length 1 maxlength 64 objectives > objectiveref reference id for individual objectives string minlength 4 maxlength 36 objectives > location location id string minlength 1 maxlength 64 objectives > contact contact id string minlength 1 maxlength 64 objectives > timeslot > from and to time slot start and end time in unix epoch format integer($int64) minimum 1 jobtypeid id of the job type string minlength 4 maxlength 64 scheduledfor > startdatetime date time number assets > documenttype type of documentation to be saved as an asset string assets > documenturl url of the documentation string the json request body should be similar to the following { "jobworkflowid" "pickupjobworkflow 11daaaf3 c0b3 4f17 b6ba 6e27d487aaa9", "jobref" "string", "objectives" \[ { "objectiveref" "pickup", "location" "location\ abce4567 e89b 12d3 a456 426614174000", "contact" "string", "timeslot" { "from" 1, "to" 1 }, "groupid" "string", "input" { "additionalprop1" {} } } ], "containers" \[ "string" ], "batchid" "string", "jobtypename" "string", "jobtypeid" "string", " event meta" {}, "scheduledfor" { "startdatetime" 0, "enddatetime" 0 }, "assets" \[ { "documenttype" "string", "description" "string", "documenturl" "string" } ], "orderid" "string", "workorderid" "string", "additionalprop1" {} } update a job to update a job, call the update job by job ref docid\ llw2pmc96 onbp4 vuixy endpoint and pass the following required members in the request body member description remarks jobref job reference string minlength 1 maxlength 64 status job status string enum \[ completed ] the json request body should be similar to the following { "jobref" "string", "status" "completed", "substatus" "string", " event meta" {}, "orderid" "string" } to update a job by job id, call the update job by job ref docid\ llw2pmc96 onbp4 vuixy endpoint and pass the following required members in the request body also, specify the jobid in the path parameter here is the markdown table member description remarks scheduledfor > startdatetime date time number assets > documenttype type of documentation to be saved as an asset string assets > documenturl url of the documentation string objectives > objectiveref reference id for individual objectives string minlength 4 maxlength 36 objectives > location location id string minlength 1 maxlength 64 objectives > contact contact id string minlength 1 maxlength 64 objectives > timeslot > from and to time slot start and end time in unix epoch format integer($int64) minimum 1 the json request body should be similar to the following { "scheduledfor" { "startdatetime" 0, "enddatetime" 0 }, "assets" \[ { "documenttype" "string", "description" "string", "documenturl" "string" } ], "batchid" "string", "objectives" \[ { "objectiveref" "string", "contact" "string", "timeslot" { "from" 1, "to" 1 }, "groupid" "string" } ], "parentjobid" "string", "removeparentjob" true, " event meta" {} } retrieve existing jobs to retrieve the existing jobs, call the get job by job id docid c5jkzirqk2vov8cdiohp endpoint and specify the jobid in the path parameter update the status and sub status of jobs to update the status and sub status of a job, call the change status and substatus of a job docid\ xzvrsff7gmoqgovxbjixf endpoint and pass the required members in the request body also, specify the jobid in the path parameter member description remarks status job status string enum \[ completed ] the json request body should be similar to the following { "status" "completed", "substatus" "string", " event meta" {} } to update the sub status of a job, call the change sub status of jobs docid 6 7zzaukmdmla kc6v8rv endpoint and pass the required members in the request body also, specify the jobid in the path parameter member description remarks substatus job sub status string maxlength 64 the json request body should be similar to the following { "substatus" "string", " event meta" {} } to update the sub status of jobs, call the change sub status of jobs docid 6 7zzaukmdmla kc6v8rv endpoint and pass the required members in the request body member description remarks jobs > jobid job id string minlength 1 maxlength 64 jobs > substatus job sub status string max length 64 the json request body should be similar to the following { "jobs" \[ { "jobid" "string", "substatus" "string" } ], " event meta" {} }