CountsAndDuration_Get (Get)
- Last UpdatedNov 06, 2025
- 3 minute read
| Get | CountsAndDuration_Get |
Resource Path:/api/countsAndDuration
| Name | Description | Data Type |
|---|---|---|
| entityID | Required. The entity ID (entityID) or the line ID (lineID). | integer |
| graphType | 0 = Utilization states. The graph shows either the counts or the duration of the utilization states for the time period specified by the filterType parameter. 1 = Utilization reason groups. The graph shows either the counts or the duration of the reason groups for the time period specified by the filterType parameter. 2 = Utilization reasons. The graph shows either the counts or the duration of the reasons for the time period specified by the filterType parameter. | integer |
| utilStateCode | The code of the utilization state by which to filter the retrieved data. | integer |
| reasGrpId | The ID of the utilization reason group by which to filter the retrieved data. | integer |
| filterType | 0 = Current hour 1 = Last n hours, where n is the number of hours specified by the filterDuration parameter 2 = Current shift 3 = Previous shift 4 = Current day 5 = Yesterday 6 = Current week 7 = Previous week 8 = Current month 9 = Previous month | integer |
| filterDuration | If the filterType parameter is set to 1, last n hours, this is the value for n (that is, the number of hours). If no value is provided, the default value of 1 hour is used. | integer |
The response body is of type Array[Mes.WebApi.Models.CountsAndDuration].
Examples: Specifying an Entity
To get the utilization state counts and durations during the current day for the entity whose ID is 13 for display in the utilization states graph:
api/CountsAndDuration?entityID=13&graphType=0&filterType=4
To get counts and durations for all utilization reasons during the last 4 hours for the entity whose ID is 13 for display in the utilization reasons graph:
api/CountsAndDuration?entityID=13&graphType=2&filterType=1&filterDuration=4
Examples: Specifying a Line
To get the utilization state counts and durations during the current day for the line whose ID is 21 for display in the utilization states graph:
api/CountsAndDuration?lineID=21&graphType=0&filterType=4
To get counts and durations for all utilization reasons during the last 4 hours for the line whose ID is 21 for display in the utilization reasons graph:
api/CountsAndDuration?lineID=21&graphType=2&filterType=1&filterDuration=4
Examples: Work Tasks Lookup, Specifying an Entity
To get the utilization state counts and durations for a specific entity:
api/CountsAndDuration?entityID={entityID}&graphType={graphType}&filterType={filterType}
To get counts and durations for all utilization states for an entity and allow the number of hours to be specified if the LastNHours time period filter is specified:
api/CountsAndDuration?entityID={entityID}&graphType={graphType}&filterType={filterType}&filterDuration={filterDuration}
Examples: Work Tasks Lookup, Specifying a Line
To get the utilization state counts and durations for a specific line:
api/CountsAndDuration?lineID={lineID}&graphType={graphType}&filterType={filterType}
To get counts and durations for all utilization states for a line and allow the number of hours to be specified if the LastNHours time period filter is specified:
api/CountsAndDuration?lineID={lineID}&graphType={graphType}&filterType={filterType}&filterDuration={filterDuration}
The returned counts and duration information can be filtered by utilization state, utilization reason group, and a time period.
Because this endpoint queries historical tables and supports custom time periods, use caution when querying large time periods (greater than a day), as system performance can be adversely affected.