cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
178
Views
0
Helpful
2
Replies

GraphQL - ElasticsearchException - isRecordingDelete CSR field

BlakeR
Level 1
Level 1

Hello,

We have started polling for CSRs for reporting purposes. We have multiple customers, and for Customer_A we had no issues with the GraphQL queries we were running.

Then, we started trying to poll for CSRs for Customer_B, and started running into the 500 response
'ElasticsearchException: failed to map source [<redacted>] to class ContactStateEntity'.

Playing around with the GraphQL query in Postman let me determine that the 'isRecordingDeleted' field provided by the CSR documentation was the cause of the error.

The 'isRecordingDeleted' from https://github.com/WebexSamples/webex-contact-center-api-samples/blob/main/reporting-samples/graphql-sample/DataDictionary/CSR.md is throwing this error when included in the query.

Excluding 'isRecordingDeleted' allows the CSRs to return with a 200 response without issue.

2 Replies 2

Janos Benyovszki
Cisco Employee
Cisco Employee

@BlakeR would you have the GraphQL query that is causing the 500 for that customer? We can have a look and see why the isRecordingDeleted parameter is causing trouble. To confirm, the query was the same for both customer, but only threw error for Customer_B, right? Thanks

@Janos Benyovszki :

What I find interesting is the GraphQL query in question started returning 500s for Customer_A too, but only for older data from back in February. The very same GraphQL query was working fine for recent date ranges including today.

How I reproduced the error for Customer_A and Customer_B:

  1. Pick a date range from February.
  2. Try to include `isRecordingDeleted` in the query.

I have copied the Postman query below:

```

query($startTime: Long!, $endTime: Long!) {
    taskDetails(
        from: $startTime # created tasks from Unix-ms
        to:   $endTime # created tasks to Unix-ms
        # filter: {
        #     and: [
        #         { endedTime: { gt: 0 } }
        #         { endedTime: { gte: $startTime } }
        #         { endedTime: { lte: $endTime } }
        #         { status:    { equals: "ended"} }
        #     ] # and
        # } # filters
        pagination : {
            # "0", "5"
            cursor : "0"
        } # pagination
    ) {
        tasks {
            id
            createdTime (sort: asc)
            endedTime
            lastActivityTime
            status
            channelType
            origin
            destination
            contactReason
            direction
            terminationType
            channelSubType
            customer {
                name
                phoneNumber
                email
            } # customer
            isActive
            isCampaign
            outdialType
            isCallback
            cpaStatus
            channelMetaData {
                email {
                    subject
                    # metadata # not defined
                }
                chat {
                    chatReason
                }
                inBoundTranscript
                outBoundTranscript
            } # channelMetaData
            callbackData {
                callbackRequestTime
                callbackConnectTime
                callbackNumber
                callbackStatus
                callbackOrigin
                callbackType
                callbackQueueName
                callbackAgentName
                callbackTeamName
                callbackRetryCount
            } # callbackData
            recordingLocation
            lastQueue {
                id
                name
                duration
            } # lastQueue
            lastSite {
                id
                name
            } # lastSite
            lastTeam {
                id
                name
            } # lastTeam
            lastEntryPoint {
                id
                name
            } # lastEntryPoint
            previousQueue {
                id
                name
            } # previousQueue
            preferredAgentSystemId
            terminationReason
            ivrScriptName
            ivrScriptTagName
            abandonedType
            contactHandleType
            feedback {
                surveyOptIn
                type
                questionsAnswered
                surveyCompleted
                questionsPresented
                comment
            } # feedback
            firstQueueName
            terminatingEnd
            lastWrapUpCodeId
            lastWrapupCodeName
            lastAgent {
                id
                name
                signInId
                sessionId
                phoneNumber
                channelId
            } # lastAgent
            abandonedSlCount
            agentHangupCount
            botName
            chainedInToEPCount
            chainedInToQueueCount
            emailBody
            emailContent
            emailContentType
            emailDate
            emailFullMessage
            emailMessageId
            emailRef
            emailReplyBody
            emailReplyContentType
            epTransferToEPCount
            firstQueueId
            fullMonitoringCount
            isHandledByPreferredAgent
            ivrEndedCount
            midcallMonitoringCount
            emailBccList
            emailCcList
            emailReplyTo
            emailToList
            isEmailSent
            routingType
            ivrScriptId
            ivrScriptTagId
            campaignId
            campaignName
            campaignStatus
            flowActivityName
            flowActivitySequence
            totalDuration
            csatScore
            blindTransferCount
            conferenceCount
            conferenceDuration
            consultCount
            consultDuration
            holdCount
            holdDuration
            selfserviceCount
            selfserviceDuration
            connectedCount
            connectedDuration
            consultToQueueCount
            consultToQueueDuration
            transferCount
            wrapupDuration
            ringingDuration
            queueDuration
            queueCount
            captureRequested
            isTranscriptionAvailable
            consultToEPCount
            consultToEPDuration
            outdialConsultToEPCount
            outdialConsultToEPDuration
            agentToDnTransferCount
            agentToAgentTransferCount
            callCompletedCount
            autoCsat
            matchedSkills
            requiredSkills
            matchedSkillsProfile
            isWithInServiceLevel
            isContactOffered
            transferErrorCount
            isContactEscalatedToQueue
            isOptOutOfQueue
            isContactHandled
            outdialConsultToQueueCount
            outdialConsultCount
            overflowCount
            pausedCount
            pausedDuration
            previousAgentId
            previousAgentSessionId
            previousAgentName
            queueTransferToEPCount
            queueTransferToQueueCount
            recordingFileSize
            recordingCount
            recordingErrorCount
            resumedCount
            shortInIVRCount
            shortInQueueCount
            silentMonitoringCount
            recordingStereoBlobId
            suddenDisconnectCount
            totalMonitoringCount
            outdialConsultToQueueDuration
            transferInToEPCount
            isOutdial
            monitoringTimestamp
            # isRecordingDeleted # Throwing 500s for older data
            isMonitored
            monitorFullName
            isBarged
            bargedInDuration
            bargedInCount
            bargedInFailedCount
            preferredAgentName
            agentTransferedInCount
            agentToEntrypointTransferCount
            agentToQueueTransferCount
            totalBnrDuration
            # CARs
            activities(first: 100) {
                # Count of CAR records
                totalCount
                # Required fields from CAR.
                pageInfo {
                    hasNextPage
                    endCursor
                } # pageInfo
                nodes {
                    id
                    isActive
                    createdTime (sort: asc)
                    endedTime # (sort: asc)
                    lastActivityTime
                    agentId
                    agentName
                    agentPhoneNumber
                    agentSessionId
                    agentChannelId
                    entrypointId
                    entrypointName
                    queueId
                    queueName
                    siteId
                    siteName
                    teamId
                    teamName
                    transferType
                    activityType
                    activityName
                    eventName
                    previousState
                    nextState
                    consultEpId
                    consultEpName
                    childContactId
                    childContactType
                    duration
                    destinationAgentPhoneNumber
                    destinationAgentId
                    destinationAgentName
                    destinationAgentSessionId
                    destinationAgentChannelId
                    destinationAgentTeamId
                    destinationAgentTeamName
                    destinationQueueName
                    destinationQueueId
                    terminationReason
                    ivrScriptId
                    ivrScriptName
                    ivrScriptTagId
                    ivrScriptTagName
                    bnrMode
                } # nodes
            } # activities
        } # tasks
        pageInfo {
            hasNextPage
            endCursor
        } # pageInfo
    }
}

```