CT Results

API Specification

Description Creates a task for WorkManager to execute exportEngine for CT Results exporter.
Authentication
Required
Yes
URL https://<domain or IP>/SMARTSync/services/rs/exporters/v1/ct-results
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: for PIPE - required, for JSON - optional.

Notes: is not case sensitive.

dateFormat - String, possible values: mmddyy, ddmmyy, mmddyyyy, ddmmyyyy, yyyymmdd, yyyyddmm, yyddmm, yymmdd.

If dateformat is not provided and outputFormat is set to JSON, all date fields will be converted to ISO date format.

Required: Only for PIPEoutputFormat.

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.

buIds - Array of integers. Should be one or more IDs user has permission to use.

ctIds - Array of integers. Should be one or more IDs user has permission to use.

Required: at least buIds or ctIds should be present in request.

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 it is set to true, headers will be excluded from PIPE output.

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":"period"}, {"name":"TZ"}, {"name":"custID"}, {"name":"saGroupID"}, {"name":"saGroupName"}, {"name":"ssGroupID"}, {"name":"ssGroupName"}, {"name":"buID"}, {"name":"buName"}, {"name":"ctID"}, {"name":"ctName"}, {"name":"acdID"}, {"name":"modify"}, {"name":"actContactsReceived"}, {"name":"actContactsHandled"}, {"name":"actAHT"}, {"name":"slPctObj"}, {"name":"actSLPct"}, {"name":"slTime"}, {"name":"asaObj"}, {"name":"actASA"}, {"name":"maxOcc"}, {"name":"actOcc"}, {"name":"actReq"}, {"name":"actContactsHandledSL"}, {"name":"actContactsAband"}, {"name":"actContactsAbandSL"}, {"name":"actOutContacts"}, {"name":"actIntContacts"}, {"name":"actBacklogNotExp"}, {"name":"actBacklogExp"}, {"name":"estStaff"}, {"name":"actLogin"}, {"name":"actTalkTime"}, {"name":"actWorkTime"}, {"name":"actOutTime"}, {"name":"actReadyTime"}, {"name":"actIdleTime"}, {"name":"actIntTime"}, {"name":"actHandledLong"}, {"name":"actAbandonLong"}, {"name":"actQueueDelay"}, {"name":"actHoldTime"}, {"name":"actATT"}, {"name":"actAWT"}, {"name":"actAOT"}

Simple fields when outputFormat is set to JSON

{"name":"date"}, {"name":"period"}, {"name":"TZ"}, {"name":"custID"}, {"name":"egID"}, {"name":"egName"}, {"name":"buID"}, {"name":"buName"}, {"name":"ctID"}, {"name":"ctName"}, {"name":"acdID"}, {"name":"modify"}, {"name":"actContactsReceived"}, {"name":"actContactsHandled"}, {"name":"actAHT"}, {"name":"slPctObj"}, {"name":"actSLPct"}, {"name":"slTime"}, {"name":"asaObj"}, {"name":"actASA"}, {"name":"maxOcc"}, {"name":"actOcc"}, {"name":"actReq"}, {"name":"actContactsHandledSL"}, {"name":"actContactsAband"}, {"name":"actContactsAbandSL"}, {"name":"actOutContacts"}, {"name":"actBacklogNotExp"}, {"name":"actBacklogExp"}, {"name":"estStaff"}, {"name":"actLogin"}, {"name":"actTalkTime"}, {"name":"actWorkTime"}, {"name":"actOutTime"}, {"name":"actReadyTime"}, {"name":"actIdleTime"}, {"name":"actHandledLong"}, {"name":"actAbandonLong"}, {"name":"actQueueDelay"}, {"name":"actHoldTime"}, {"name":"actATT"}, {"name":"actAWT"}, {"name":"actAOT"}

Note: 

  • In the fields array parameter, the output fields  saGroupID,  saGroupName,  ssGroupIDssGroupNameactIntContacts and  actIntTime may be used for PIPE output.
  • For JSON output  saGroupID must be replaced with  egID, and  saGroupName with  egName
  • Fields  saGroupIDsaGroupNamessGroupIDssGroupNameactIntContacts and  actIntTime may not be used for JSON output.
  • Only one field with the same name can be present in the fields array.

sortOrder - 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: 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 'BU -1'",
"Insufficient permissions to view entities 'CT -1'",
        "Invalid entity: 'BU 1234567'",
      "Invalid entity: 'CT 1234567'",
       "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/ct-results

request body(request for all fields):

{
 "startDate":"2023-11-10",
 "endDate":"2024-11-10",
 "outputFormat":"PIPE",
 "dateFormat":"ddmmyyyy",
 "timeFormat":"12",
 "buIds":[
   500
  ],
 "ctIds":[
   500
  ]
}


request body(request for specific fields):

{
 "startDate":"2022-11-10",
 "endDate":"2022-11-10",
 "outputFormat":"PIPE",
 "dateFormat":"ddmmyyyy",
 "timeFormat":"12",
 "buIds":[
   500
  ],
 "ctIds":[
   500
  ],
 "fields":[{"name":"custID"}, {"name":"TZ"}],
 "sortOrder":[{"name":"custID"}, {"name":"TZ"}]
Sample Call for JSON outputFormat

https://localhost/SMARTSync/services/rs/exporters/v1/ct-results

request body(request for all fields):

{
"startDate":"2023-11-10",
"endDate":"2024-11-10",
"outputFormat":"JSON",
"dateFormat":"ddmmyyyy",
"keepEmptyJsonFields":true,
"timeFormat":"12",
"buIds":[
   500
  ],
 "ctIds":[
   500
  ]
}
request body(request for specific fields):
{
   "startDate":"2022-11-10",
   "endDate":"2022-11-10",
   "outputFormat":"JSON",
   "dateFormat":"ddmmyyyy",
   "timeFormat":"12",
   "keepEmptyJsonFields":true,
   "buIds":[
   500
  ],
 "ctIds":[
   500
  ],
 "fields":[{"name":"custID"}, {"name":"TZ"}],
 "sortOrder":[{"name":"custID"}, {"name":"TZ"}]
}
}

Output Field Descriptions

  • This export runs for each BU specified in the buIds parameter. When run for a BU, the output includes the data for each CT that belongs to the BU during the specified date range, if you appropriately maintained the entity relationships and forecasts/plans.

  • In addition, this export runs for each CT specified in the ctIds parameter. If a CT specified in the ctIds element belongs to a BU that is also specified in the buIds element, the data for the CT is only included one time.

  • If the export is to run for multiple CTs or BUs, all data is saved in the same output file.

  • The output file contains one record for each CT, for each statistics period of each date in the selected date range. CT hours are not taken into account.

  • Data is read from the result table and is only included for past dates. If none of the dates in the specified range are in the past, the output file is empty.

This export uses the CT time zone setting. The export does not differentiate between the duplicate periods that occur on the Daylight Saving Time (DST) date. It does not show which of the duplicate periods occurred first on a DST date with multiple entries for the same period.

The CT Results output can contain these fields:

Field

Description

Values

date

The date based on the CT’s time zone.

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.

 

period

The start time of the period, based on the CT’s time zone.

The format of this time is specified in the timeFormat attribute. If no timeFormat attribute exists, 24-hour format is used.

 

TZ

The CT’s time zone.

 

custID

The customer ID.

 

saGroupID

The ID of the EG to which the CT belongs on the date being exported.

This field is blank if the CT does not belong to an EG.

saGroupName

The EG name.

This field is blank if the CT does not belong to an EG.

ssGroupID

The ID of the skill scheduling group to which the CT belongs on the date being exported.

This field is blank.

ssGroupName

The skill scheduling group name.

This field is blank.

buID

The ID of the BU to which the CT belongs on the date being exported.

If the CT does not belong to a BU, or if the BU cannot be determined because the user did not appropriately maintain the entity relationships and forecast/plan, this field is blank.

buName

The BU name.

This field is blank if the CT does not belong to a BU, or if the BU cannot be determined.

ctID

The ID of the CT.

 

ctName

The name of the CT.

 

acdID

The ID of the CT’s default ACD or multimedia server.

 

modify

The record’s modify timestamp.

 

actContactsReceived

The actual number of contacts received for the CT for the period.

For workload-based CTs, the value is provided by an external system.

For simulation-based and BErlangC-based CTs, the value is the sum of actContactsHandled + actContactsAband.

actContactsHandled

The CT’s actual number of contacts handled.

The value is the sum of actHandledLong + actHandledShort.

actAHT

The CT’s actual average handle time.

Formatted to 2 decimal places.

slPctObj

The service level percent objective.

Formatted to 2 decimal places.

actSLPct

The CT’s actual service level percent.

 

slTime

The CT’s service level time objective, in seconds.

 

asaObj

The ASA objective.

Formatted to 2 decimal places.

actASA

The actual ASA.

Formatted to 2 decimal places.

maxOcc

The maximum occupancy objective.

Formatted to 2 decimal places.

actOcc

The CT’s actual occupancy.

0 - 100, formatted to 2 decimal places.

actReq

The CT’s actual requirement.

Formatted to 2 decimal places. This field is blank for workload-based CTs.

The value represents the requirements which meet or exceed all three forecast objectives, service level, ASA, and maximum occupancy, and includes adjustments for:

  • BU efficiency, for CTs that belong to a BU

  • Multi-skill ffficiency

actContactsHandledSL

The CT’s actual number of contacts handled before the time threshold defined on the ACD or multimedia server.

This field is known as actHandledShort.

 

actContactsAband

The CT’s actual number of contacts abandoned.

The value is the sum of actAbandonLong + actAbandonShort.

actContactsAbandSL

The CT’s actual number of contacts abandoned before the time threshold defined on the ACD or multimedia server.

This value is known as actAbandonShort.

The value in this field is one of these:

  • a derived value NICE WFM calculates using information from the ACD or multimedia server interface

  • an actual value from the ACD or multimedia server database

Note: If the derived value is not appropriate, you may contact NICE WFM Support to determine if your ACD or multimedia server is capable of providing the value directly from the ACD or multimedia server database. Professional service fees may apply to modify the ACD or multimedia server integration and interface.

actOutContacts

The CT’s actual number of outbound contacts.

 

actIntContacts

The CT’s actual number of internal contacts.

This field is blank.

actBacklogNotExp

The number of contacts remaining to handle that have not yet exceeded the service time defined for the period in which they were received.

This field is blank for simulation based and BerlangC.

actBacklogExp

The number of contacts remaining to handle that have already exceeded the service time defined for the period in which they were received.

This field is blank for simulation based and BerlangC.

estStaff

The CT’s estimated staff.

Formatted to 2 decimal places.

actLogin

The actual number of seconds agents spent logged in for the CT.

 

actTalkTime

The actual number of seconds agents spent handling incoming contacts for the CT.

 

actWorkTime

The actual number of seconds agents spent in after contact work for the CT.

 

actOutTime

The actual number of seconds agents spent on outgoing contacts for the CT.

 

actReadyTime

The actual number of seconds agents spent in a ready state for the CT.

 

actNotReadyTime

The actual number of seconds agents spent in an idle, AUX or not ready state for the CT.

 

actIntTime

The actual number of seconds agents spent on internal contacts for the CT for the period.

This field is blank.

actHandledLong

The actual number of contacts handled after the time threshold defined on the ACD or multimedia server.

The value in this field is one of these:

  • a derived value NICE WFM calculates using information from the ACD or multimedia server interface

  • an actual value from the ACD or or multimedia server database

Note: If the derived value is not appropriate, you may contact NICE WFM Support to determine if your ACD or multimedia server is capable of providing the value directly from the ACD or multimedia server database. Professional service fees may apply to modify the ACD or multimedia server integration and interface.

actAbandonLong

The actual number of contacts abandoned after the time threshold defined on the ACD or multimedia server.

The value in this field is one of these:

  • a derived value NICE WFM calculates using information from the ACD or multimedia server interface

  • an actual value from the ACD or or multimedia server database

Note: If the derived value is not appropriate, you may contact NICE WFM Support to determine if your ACD or multimedia server is capable of providing the value directly from the ACD or multimedia server database. Professional service fees may apply to modify the ACD or multimedia server integration and interface.

actQueueDelay

The actual number of seconds contacts remained in queue.

 

actHoldTime

The actual number of seconds agents placed contacts in a hold state while handling the contact.

 

actATT

The actual average talk time, in seconds, for the queue.

Formatted to 2 decimal places.

actAWT

The actual average work time, in seconds, for the queue.

Formatted to 2 decimal places.

actAOT

The actual average outbound time, in seconds, for the queue.

Formatted to 2 decimal places.

 

Supported output formats:

  • Pipe delimited
  • JSON

JSON Results with non empty fields

JSON Results with empty fields

PIPE results with enabled headers

PIPE Results with disabled headers

DTD example