post https://api.motioncxapps.com/reporting/api/v1/agent/workstate/rollup
This endpoint will return the amount of time (in seconds) for all workstates used by an agent, by individual Agent ID.
Agent Workstate Rollup from Reporting API
This endpoint will return the amount of time (in seconds) for all workstates used by an agent, by individual Agent ID.
- Authentication required, please visit this page for Authentication How To.
Parameters
Parameter | Required? | Description |
---|---|---|
queues | No | Array of QueueIds in integer format. If defined, only agent data for the specified queues will be returned. |
agents | No | Array of AgentIds in integer format. If defined, only agent data for the specified agents will be returned. |
startDateTime | Yes - if relativePeriodStart is undefined. | Datetime in ISO 8601 format ("YYYY-MM-DDThh:mm:ssZ", e.g. "2023-01-01T08:00:00Z"). |
endDateTime | Yes - if relativePeriodEnd is undefined | Datetime in ISO 8601 format ("YYYY-MM-DDThh:mm:ssZ", e.g. "2023-01-01T08:00:00Z"). |
relativePeriodStart | No | Start time using a count of periods defined by the resolution parameter. Must be a negative integer to indicate periods in the past. |
relativePeriodEnd | No | End time using a count of periods defined by the resolution parameter. Must be a negative integer smaller than the relativePeriodStart value. |
relativeTimezone | No | If the resolution period is set to daily ('2') the Timezone parameter can be used to summarize data by the defined time zone. Allowed values are defined at this page on Time Zones. |
resolution | Yes - if relativePeriodStart is defined | the length of the time periods used for the relativePeriod parameters and the summarization of data returned. Set to 0 for quarter-hourly, 1 for hourly, and 2 for daily. |
includeInactiveTime | No | This parameter is assumed to be false if not defined. Setting to true will include agents with no logged in time during the specified date range. |
Responses available:
- 200
- 401
- 403
Example return:
{
"resultCode": 0,
"resultCodeName": "Success",
"data": [
{
"StateIdDurations": [
{
"StateId": 0,
"State": 3,
"SubState": 0,
"Duration": 537
},
{
"StateId": 1,
"State": 0,
"SubState": 0,
"Duration": 363
}
],
"TotalDuration": 900,
"AgentId": 18605,
"RollupDate": "2023-09-21T15:45:00Z"
},
{
"StateIdDurations": [
{
"StateId": 1,
"State": 0,
"SubState": 0,
"Duration": 900
}
],
"TotalDuration": 900,
"AgentId": 18605,
"RollupDate": "2023-09-21T16:00:00Z"
},
{
"StateIdDurations": [
{
"StateId": 1,
"State": 0,
"SubState": 0,
"Duration": 900
}
],
"TotalDuration": 900,
"AgentId": 18605,
"RollupDate": "2023-09-21T16:15:00Z"
},
{
"StateIdDurations": [
{
"StateId": 1,
"State": 0,
"SubState": 0,
"Duration": 900
}
],
"TotalDuration": 900,
"AgentId": 18605,
"RollupDate": "2023-09-21T16:30:00Z"
},
{
"StateIdDurations": [
{
"StateId": 1,
"State": 0,
"SubState": 0,
"Duration": 900
}
],
"TotalDuration": 900,
"AgentId": 18605,
"RollupDate": "2023-09-21T16:45:00Z"
}
],
"dataType": "JObject",
"hasPaging": false
}