Agent Schedule Summary
API Specification
Description | Creates a task for WorkManager to execute exportEngine for Agent Schedule Summary exporter. |
Authentication Required | yes |
URL | https://<domain or IP>/SMARTSync/services/rs/exporters/v1/agent-schedule-summary |
Method | POST |
Request Headers |
Cookie: JSESSIONID={jsessionId} Content-Type: application/json |
Request Params | (See below) |
API Specification: Request Params
startDate- String, format: YYYY-MM-YY Required: true. Notes: cannot be after the endDate |
endDate - String, format: YYYY-MM-YY Required: true. Notes: cannot be before the startDate |
outputFormat - String, supported formats: PIPE, JSON Required: true. Notes: is not case sensitive |
dateFormat - String, possible values: mmddyy, ddmmyy, mmddyyyy, ddmmyyyy, yyyymmdd, yyyyddmm, yyddmm, yymmdd. If dateFormat is not defined and outputFormat is set to JSON then all date fields will be converted into ISO date format. Required: Only for PIPE outputFormat. Notes: is not case sensitive. Determines format of output dates. |
timeFormat - String, possible values: 12, 24. Determines format of output times. Required: true. Notes: is not case sensitive |
muIds - array of Integers. Should be one or more IDs user has permission to use. Required: true. Notes: is not case sensitive |
keepEmptyJsonFields - boolean field. Required: false. Notes: This field can be set only if outputFormat is set to JSON. By default it is false. If set to true then JSON output will contain empty values ({},[],"") for fields. |
excludePipeHeader - boolean field. Required: false. Notes: This field can be set only if outputFormat is PIPE. By default it is false. If set to true then headers will be excluded from PIPE output. |
attribute - String. Represents activity code attribute. Required: false. Notes:
|
fields - array of Objects. Represents the list of the supported field names, fields with attribute values and fields with specified value. All field names, attributes and values are not case sensitive. Required: false. Possible values: Simple fields when outputFormat is PIPE: {"name":"date"}, {"name":"minutes"}, {"name":"TZ"}, {"name":"custID"}, {"name":"muID"}, {"name":"tvID"}, {"name":"acdID"}, {"name":"logonID"}, {"name":"ssn"}, {"name":"agentName"}, {"name":"modify"}, {"name":"exception"}, {"name":"externalID"} Simple fields when outputFormat is JSON: {"name":"date"}, {"name":"minutes"}, {"name":"TZ"}, {"name":"custID"}, {"name":"muID"}, {"name":"tvID"}, {"name":"acdID"}, {"name":"logonID"}, {"name":"personalID"}, {"name":"agentName"}, {"name":"modify"}, {"name":"exception"}, {"name":"externalID"} Notes:
Field with multi value: {"name":"agentData","value":"value1"}, {"name":"agentData","value":"value2"} Note: agentData value should exists in DB. |
sortOrder - array of Objects. Represents the list of the supported field names ,fields with attribute values and fields with specified value. Al field names, attributes and values are not case sensitive. Required: false. Possible values: the same values as for fields. |
API Specification (cont)
Response Data |
Response has a unique JobId: jobId is a 32 length string Example {
"jobId":"9b2fe7bb8362429fb85a16c9373cf50c"
}
|
Response Headers | Content-Type: application/json |
Success Response | Code: 200 OK Content : [Response Data] |
Error Response |
Code: 401 Unauthorized Error message: {
"message":"Unauthorized",
"status":401
}
Code: 400 Bad Request
All fields are invalid:
{
"message":"One or more request validations failed",
"status":400,
"details": [
"Invalid field: 'keepEmptyJsonFields'",
"Invalid field: 'excludePipeHeader'",
"Invalid outputFormat value: 'XML'",
"Invalid dateFormat value: 'ddmmcyyyy'",
"Invalid timeFormat value: '1c2'",
"startDate must match the provided yyyy-MM-dd format",
"endDate must match the provided yyyy-MM-dd format",
"Insufficient permissions to view entities 'MU -1'",
"Invalid entity: 'MU 1234567'",
"Invalid attribute value: 'wrongAttribute'",
"Invalid values within fields element: wrongField2,wrongField1"
]
}
Start date>end date
{
"message":"One or more request validations failed",
"status":400,
"details": [
"endDate must be either equal to or after the startDate"
]
}
Code: 500 Internal server error
|
Sample Call for PIPE outputFormat |
https://localhost/SMARTSync/services/rs/exporters/v1/agent-schedule-summary request body (request for all fields): {
"startDate":"2023-11-10",
"endDate":"2024-11-10",
"outputFormat":"PIPE",
"dateFormat":"ddmmyyyy",
"timeFormat":"12",
"muIds":[
500
]
}
request body (request for specific fields): {
"startDate":"2022-11-10",
"endDate":"2022-11-10",
"outputFormat":"PIPE",
"dateFormat":"ddmmyyyy",
"timeFormat":"12",
"muIds":[
500
],
"attribute":"Adherence",
"fields":[{"name":"custID"}, {"name":"TZ"}],
"sortOrder":[{"name":"custID"}, {"name":"TZ"}, {"name":"agentData","value":"TEST"}]
}
|
Sample Call for JSON outputFormat |
https://localhost/SMARTSync/services/rs/exporters/v1/agent-schedule-summary request body (request for all fields): {
"startDate":"2023-11-10",
"endDate":"2024-11-10",
"outputFormat":"JSON",
"dateFormat":"ddmmyyyy",
"keepEmptyJsonFields":true,
"timeFormat":"12",
"muIds":[
500
]
}
request body(request for specific fields):
{
"startDate":"2022-11-10",
"endDate":"2022-11-10",
"outputFormat":"JSON",
"dateFormat":"ddmmyyyy",
"timeFormat":"12",
"keepEmptyJsonFields":true,
"muIds": [
500
],
"attribute":"Adherence",
"fields":[{"name":"custID"}, {"name":"TZ"}],
"sortOrder":[{"name":"custID"}, {"name":"TZ"}, {"name":"agentData","value":"TEST"}]
}
}
|
Output Field Descriptions
-
This export runs for each MU specified in the muIds list.
-
If the export runs for multiple MUs, all the data is saved in the same output file.
-
For each date in the range specified, the Activity data is read for each agent that belongs to the MU being processed for the date being processed.
-
Rather than using the schedule’s start date, the date on which an activity code occurs determines which date record includes the activity code. Therefore, this exporter reads schedules for the day before the specified start date, to include activity codes that cross midnight from the previous day into the start date. If an agent’s schedule crosses midnight into the day after the specified end date, the activity codes that fall on the day after the end date are excluded from the export.
-
If the attribute parameter is defined, the value assigned to each activity code for the specified activity code attribute is used for the output file’s exception field. If the attribute parameter is not defined, the attribute named EXC_EXPORT is used.
-
Agent data group values assigned to the agent for the date being processed are exported. Agent data group values are stored by date range and are not dependent on the agent’s MU assignment.
The Agent Schedule Summary output can include these fields:
Field |
Description |
Values |
---|---|---|
date |
The activity code date, based on the MU’s time zone. The activity code date may be different from the schedule date, if the schedule crosses midnight. The format of the date is specified in the dateFormat parameter. If no dateFormat is provided, then the format defaults to mmddyyyy if the outputFormat is PIPE. If the outputFormat is JSON, then dates default to ISO 8601 format. If the outputFormat is XML, the format is always a fixed XML structure. Note: Only the activity code date is shown; the schedule date is omitted because the number of minutes an agent spent in an activity code for a day may have come from two different schedules, if the agent worked a cross-midnight schedule. |
|
TZ |
The MU’s time zone. |
|
custID |
The customer ID. |
|
muID |
The ID of the MU. |
|
tvID |
The agent’s WFM ID. |
|
acdID |
The ID of the agent’s highest-priority ACD for the associated schedule date. The highest-priority ACD is the one with the lowest priority number. |
|
logonID |
The agent’s highest-priority ACD or multimedia server logon ID for the associated schedule date. The highest-priority ACD is the one with the lowest priority number. |
It is possible for this field to be blank. |
ssn |
The agent’s personal ID number. For JSON output, personalId is used instead
|
This field is blank if no personal ID number is assigned to the agent. |
agentData |
This multi-value field exports the value(s) assigned to the agent for each agent data group specified in the "value" attribute of the agentData field. You can include as many agentData elements as you want; one agent data group is printed in the output file for each agentData value defined. You can specify the same agent data group more than once. If you do not include an agentData element, this field is omitted. |
This field may be blank if the agent currently belongs to an MU that is different from the MU being processed. Agent data group values are only stored for the agent’s latest MU. |
agentName |
The agent’s name, formatted as <last>, <first><suffix>. |
|
modify |
The schedule record’s modify timestamp. |
|
exception |
The activity code attribute value assigned to the activity code, as specified in the attribute parameter . If no value is assigned to the activity code for the activity code attribute, the activity code is not included in the export. If multiple activity codes with the same activity code attribute value exist, they are exported as a single exception, and the minutes field contains the total number of minutes for the activity codes. If an activity code crosses midnight, it is divided into two records at midnight. |
|
minutes |
The total number of minutes the activity code exists in the agent’s schedule for the date. |
|
externalID |
The ID the agent uses to log in to Agent WebStation if the WebStation is configured to use external IDs. |
If the agent's externalID field is blank, this field is blank. |
Supported output formats:
- Pipe delimited
- JSON
JSON with results and non empty fields

[
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1001",
"acdID": "1",
"logonID": "1001",
"agentName": "1001, 1001",
"modify": "2020-12-21T12:38:22Z",
"exception": "open",
"minutes": "570" },
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1002",
"acdID": "1",
"logonID": "1002",
"agentName": "1002, 1002",
"modify": "2020-12-21T12:38:22Z",
"exception": "open",
"minutes": "570" },
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1003",
"acdID": "1",
"logonID": "1003",
"agentName": "1003, 1003",
"modify": "2020-12-21T12:38:23Z",
"exception": "open",
"minutes": "570" },
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1004",
"acdID": "1",
"logonID": "1004",
"agentName": "1004, 1004",
"modify": "2020-12-21T12:38:23Z",
"exception": "open",
"minutes": "570" },
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1005",
"acdID": "1",
"logonID": "1005",
"agentName": "1005, 1005",
"modify": "2020-12-21T12:38:23Z",
"exception": "open",
"minutes": "570" },
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1006",
"acdID": "1",
"logonID": "1006",
"agentName": "1006, 1006",
"modify": "2020-12-21T12:38:23Z",
"exception": "open",
"minutes": "570" },
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1007",
"acdID": "1",
"logonID": "1007",
"agentName": "1007, 1007",
"modify": "2020-12-21T12:38:23Z",
"exception": "open",
"minutes": "570" }
]
JSON with results and empty fields

[
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1001",
"acdID": "1",
"logonID": "1001",
"personalID": "",
"agentName": "1001, 1001",
"modify": "2020-12-21T12:38:22Z",
"exception": "open",
"minutes": "570",
"externalID": "" },
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1002",
"acdID": "1",
"logonID": "1002",
"personalID": "",
"agentName": "1002, 1002",
"modify": "2020-12-21T12:38:22Z",
"exception": "open",
"minutes": "570",
"externalID": "" },
{
"date": "09012021",
"TZ": "Asia/Jerusalem",
"custID": "1",
"muID": "1",
"tvID": "1003",
"acdID": "1",
"logonID": "1003",
"personalID": "",
"agentName": "1003, 1003",
"modify": "2020-12-21T12:38:23Z",
"exception": "open",
"minutes": "570",
"externalID": "" }
]
PIPE result with enabled headers

#fields:date|TZ|custID|muID|tvID|acdID|logonID|ssn|agentName|modify|exception|minutes|externalID
#sort:date,TZ,custID,muID,tvID,acdID,logonID,ssn,agentName,modify,exception,minutes,externalID
09012021|Asia/Jerusalem|1|1|1001|1|1001||1001, 1001|1608554302|open|570|
09012021|Asia/Jerusalem|1|1|1002|1|1002||1002, 1002|1608554302|open|570|
09012021|Asia/Jerusalem|1|1|1003|1|1003||1003, 1003|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1004|1|1004||1004, 1004|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1005|1|1005||1005, 1005|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1006|1|1006||1006, 1006|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1007|1|1007||1007, 1007|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1008|1|1008||1008, 1008|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1009|1|1009||1009, 1009|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1010|1|1010||1010, 1010|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1011|1|1011||1011, 1011|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1012|1|1012||1012, 1012|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1013|1|1013||1013, 1013|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1014|1|1014||1014, 1014|1608554303|open|570|
09012021|US/Central|1|101|523|1|L_523||523, 523|1609850640|open|570|
}
PIPE with disabled headers

09012021|Asia/Jerusalem|1|1|1001|1|1001||1001, 1001|1608554302|open|570|
09012021|Asia/Jerusalem|1|1|1002|1|1002||1002, 1002|1608554302|open|570|
09012021|Asia/Jerusalem|1|1|1003|1|1003||1003, 1003|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1004|1|1004||1004, 1004|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1005|1|1005||1005, 1005|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1006|1|1006||1006, 1006|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1007|1|1007||1007, 1007|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1008|1|1008||1008, 1008|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1009|1|1009||1009, 1009|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1010|1|1010||1010, 1010|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1011|1|1011||1011, 1011|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1012|1|1012||1012, 1012|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1013|1|1013||1013, 1013|1608554303|open|570|
09012021|Asia/Jerusalem|1|1|1014|1|1014||1014, 1014|1608554303|open|570|
09012021|US/Central|1|101|523|1|L_523||523, 523|1609850640|open|570|
Agent Schedule Detail DTD

<?xml version="1.0"?>
<!ELEMENT agentScheduleSummary ((allFields | fieldList), sortOrder?)>
<!ELEMENT fieldList (fields)>
<!ELEMENT sortOrder (fields)>
<!ELEMENT fields (date | TZ | custID | muID | tvID | acdID | logonID | ssn |
agentData | agentName |modify | exception | minutes | externalID)+>
<!ELEMENT allFields EMPTY>
<!ELEMENT date EMPTY>
<!ELEMENT TZ EMPTY>
<!ELEMENT custID EMPTY>
<!ELEMENT muID EMPTY>
<!ELEMENT tvID EMPTY>
<!ELEMENT acdID EMPTY>
<!ELEMENT logonID EMPTY>
<!ELEMENT ssn EMPTY>
<!ELEMENT agentData (#PCDATA)>
<!ELEMENT agentName EMPTY>
<!ELEMENT modify EMPTY>
<!ELEMENT exception EMPTY>
<!ELEMENT minutes EMPTY>
<!ELEMENT externalID EMPTY>