Jobs_Put (Put)
- Last UpdatedNov 06, 2025
- 3 minute read
| Put | Jobs_Put |
Resource Path:/api/Jobs
You can use this endpoint in the following ways:
- To change a ready (New or Ready) or paused (Suspended, On Hold) job to running, or change a running job to Complete to end it.
- To change the job state to a desired, valid state.
Both approaches use the woId, operId, and seqNo parameters in the Parameters table to identify the job.
The enumeration values that indicate the job states are:
1 = New
2 = Ready
3 = Running (in progress)
4 = Complete
5 = Suspended
6 = On Hold
7 = Canceled
To Start a Ready or Paused Job, or End a Running Job
- Use the woId, operId, and seqNo parameters to identify the job. If this job information is not supplied, then the system will check the job_pos property specified in the request body to identity the job. If the job_pos property is not supplied, then the system will check job position 0 to identify the job.
- In the request body, set the Job model state_cd property to the current state of the job. For example, if the job is currently in the Ready state, the state_cd property will be 2.
- In the request body, set the run_ent_id property to specify the entity for the job.
The other Job model property values are ignored.
When the call is processed:
- If the state_cd property passed in the model is 1, 2, 5, or 6 (New, Ready, Suspended, On Hold), the job's state will be changed to 3 (Running).
- If the state_cd property passed in the model is 3 (Running), the job's state will be changed to 4. (Completed).
To Change the Job State
- Use the woId, operId, and seqNo parameters to identify the job.
- Use the stateCd parameter to specify the enumeration code for the new state. The new state must be valid within the context of the current state. For example, the Complete state cannot be changed to the New state.
- Optionally, use the notes parameter to include a notes string about the job state change.
- In the request body, use the run_ent_id property to specify the entity for the job. The other properties in the model are ignored, including the state_cd property.
| Name | Description | Data Type |
|---|---|---|
| woId | Required. The work order ID of the target job. | string |
| operId | Required. The operation ID of the target job. | string |
| seqNo | Required. The sequence number of the target job. | integer |
The request body is of type Mes.WebApi.Models.Job.
The response body is of type Mes.WebApi.Models.Job.
For a job with a current state of New, Ready, Suspended, or On Hold, and assuming that the state_cd property in the Job model request body is set to the actual current state, the following call will change its state to Running:
host_name/mesmw/api/jobs?woId=20200823.01&operId=1&seqno=0
For a job with a current state of Running, and assuming that the state_cd property is set to 3, the following call will change its state to Complete:
host_name/mesmw/api/jobs?woId=20200823.01&operId=1&seqno=0
For a job with a current state of New, the following call will change its state to Ready:
host_name/mesmw/api/jobs?woId=20200823.01&operId=1&seqno=0&stateCd=2