CT Queue Data

API Specification

Description Creates a task for workmanager to execute exportEngine for CT Queue Data exporter.
Authentication Required yes
URL https://<domain or IP>/SMARTSync/services/rs/exporters/v1/ct-queue-data
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 defined and outputFormat is set to JSON then all date fields will be converted into 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 set to true then 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. Al 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":"queueID"}, {"name":"queueName"}, {"name":"acdID"}, {"name":"modify"}, {"name":"actContactsReceived"}, {"name":"actContactsHandled"}, {"name":"actContactsAband"}, {"name":"actOutContacts"}, {"name":"actContactsHandledSL"}, {"name":"actContactsAbandSL"}, {"name":"actASA"}, {"name":"actATT"}, {"name":"actAWT"}, {"name":"actAOT"}, {"name":"actAHT"}, {"name":"actSLPct"}, {"name":"actOcc"}, {"name":"estStaff"}, {"name":"actHandledLong"}, {"name":"actAbandonLong"}, {"name":"actBacklogNotExp"}, {"name":"actBacklogExp"}, {"name":"actLogin"}, {"name":"actTalkTime"}, {"name":"actWorkTime"}, {"name":"actOutTime"}, {"name":"actReadyTime"}, {"name":"actNotReadyTime"}, {"name":"actHoldTime"}, {"name":"actQueueDelay"}

Simple fields when outputFormat is JSON

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

Note: 

  • In the fields array parameter, the output fields saGroupID, saGroupNamessGroupID, ssGroupName may be used only for PIPE output. But in JSON format saGroupID must be replaced with egID, saGroupName with egName. And ssGroupID,ssGroupName can't be present in fields for JSON output format.
  • 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. 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 '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-queue-data

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-queue-data

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 runs for multiple CTs or BUs, all data is saved in the same output file.

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

  • If data does not exist for a date in the specified range, that date is omitted from the output file.

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 Queue Data 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 forecasts/plans, 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.

 

queueID

The ID of the queue. This is the acdQueueTag from the queue table.

 

queueName

The name of the queue.

 

acdID

The ID of the ACD or multimedia server to which the queue is assigned.

 

modify

The record’s modify timestamp.

 

actContactsReceived

The actual number of contacts received for the queue.

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 actual number of contacts handled for the queue.

The value is the sum of actHandledLong + actHandledShort.

actContactsAband

The actual number of contacts abandoned for the queue.

The value is the sum of actAbandonLong + actAbandonShort.

actOutContacts

The actual number of outbound contacts for the queue.

 

actContactsHandledSL

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

This field is known as actHandledShort.

 

actContactsAbandSL

The 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.

actASA

The actual average speed of answer, in seconds, for the queue.

 

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.

actAHT

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

Formatted to 2 decimal places.

actSLPct

The actual service level percent for the queue.

 

actOcc

The actual occupancy for the queue.

Format: 0 - 100, to 2 decimal places.

estStaff

The queue’s estimated staff.

Formatted to 2 decimal places.

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 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 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.

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 queues assigned to simulation-based and BerlangC-based CTs.

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 queues assigned to simulation-based and BerlangC-based CTs.

actLogin

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

 

actTalkTime

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

 

actWorkTime

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

 

actOutTime

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

 

actReadyTime

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

 

actNotReadyTime

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

 

actHoldTime

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

 

actQueueDelay

The actual number of seconds contacts remained in queue.

 

 

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