V3_UtilHistory_Post (Post)
- Last UpdatedNov 06, 2025
- 2 minute read
| Post | V3_UtilHistory_Post |
Resource Path:/api/V3/UtilHistory
| Name | Description |
|---|---|
| trans_id | Used to supply the ID of the transaction if the call is taking part in a transaction. |
The request body is of type Mes.WebApi.Models.V3.Util.UtilEvent.
The response body is of type Mes.WebApi.Models.V3.Util.UtilEvent.
OKThe following UtilEvent model properties must have non-null values:
- To identify the entity to which the utilization event is being added: ent_id.
- To provide the time when the event is to start: event_time_utc.
- To provide the reason for the event: reas_cd.
The transactions that can be executed using this operation are described below. In the examples provided, assume that the current time is 10:05 and the following event sequence exists: 6:00, Running; 7:00, Idle; 8:00, Downtime.
To add a new event whose start time is the current time:
Pass a null in the event_time_utc model property (the update_if_exists flag can be true or false). The new event becomes the current event (in our example, starting at 10:05). No previous events for the entity are affected.
To add a new past event:
Pass the start time in UTC in the event_time_utc model property (the start time must not match that of an existing event; the update_if_exists flag can be true or false).
If the start time occurred during an event prior to the current event, then the past event during which the start time occurred is split into the existing past event and the new past event. If the new past event has the same reason as the next event, those two events are merged.
For example, if event_time_utc is 6:30 with the reason Machine Jam, then the updated event sequence will be: 6:00, Running; 6:30, Machine Jam; 7:00, Idle; 8:00, Downtime.
If event_time_utc is 6:30 with the reason Idle, then the updated event sequence will be: 6:00, Running; 6:30, Idle; 8:00, Downtime.
If the start time occurred during the current event, then the old current event is split at the passed start time, and the new event becomes the current event. For example, if event_time_utc is 9:00 with the reason Machine Jam, then the updated event sequence will be: 6:00, Running; 7:00, Idle; 8:00, Downtime; 9:00, Machine Jam.
To modify an event:
Pass the start time of the event to be modified in the event_time_utc model property and set the update_if_exists flag to true. The existing event's reason code, reason pending, raw reason code, and comments will be updated with the supplied values.