OS1 Services
...
Dispatch Service
Integrate with Dispatch

How to: Manage Jobs

11min

For information about prerequisites, see Integrate with Dispatch.

Create Job Attributes

To create Job Attributes, call the Post Job Attribute 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:

JSON


Retrieve Job Attributes

To retrieve Job Attributes, call the Get Job Attribute endpoint and specify the jobTypeId in the path parameter.

Create a Job

To create a Job, call the Create Job 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:

JSON


Update a Job

To update a Job, call the Update Job 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:

JSON


To update a Job by Job ID, call the Update Job by Job ID 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:

JSON


Retrieve existing Jobs

To retrieve the existing Jobs, call the Get Job 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 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:

JSON


To update the sub-status of a Job, call the Change Sub-Status of Job 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:

JSON


To update the sub-status of Jobs, call the Change Sub-Status of Job 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:

JSON