Legacy Dev Forum Posts

 View Only

Sign Up

Is there an aggregate for Wrap-up Details?

  • 1.  Is there an aggregate for Wrap-up Details?

    Posted 06-05-2025 18:12

    dkprado | 2017-06-21 18:35:56 UTC | #1

    Hi there.

    I need to count the Wrap-ups by their customized details, just like the Campaign Details View page does. Is there an aggregate for this metric? I couldn't find one.

    Thank you!


    tim.smith | 2017-06-21 18:51:31 UTC | #2

    Can you explain what you mean by "customized details"? Are you referring to the wrap-up notes? If that's the case, there are no aggregations for that data. You will need to retrieve the conversation details and aggregate them in your application.


    dkprado | 2017-06-21 18:55:47 UTC | #3

    Thanks for the reply, Tim. I'm afraid it is not the wrap-up note. It is the details as shown in the campaign details page. Just like this:

    <img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/30efc57dcd796e04400dd51a63539aea7ce87407.png" width="690" height="340">


    tim.smith | 2017-06-21 19:02:30 UTC | #4

    I think the conversation aggregate query (POST /api/v2/analytics/conversations/aggregates/query will get you the data you want. The key is to group by wrapUpCode, and then apply any filters necessary for the dataset you want.

    Here's a sample query. You can build your own using the Developer Tools Query Builder

    {
     "interval": "2017-06-21T06:00:00.000Z/2017-06-22T06:00:00.000Z",
     "groupBy": [
      "wrapUpCode"
     ],
     "filter": {
      "type": "or",
      "predicates": [
       {
        "type": "dimension",
        "dimension": "queueId",
        "operator": "matches",
        "value": "636f60d4-04d9-4715-9350-7125b9b553db"
       }
      ]
     }
    }

    dkprado | 2017-06-21 19:37:45 UTC | #5

    This query works. And then I can get the descriptions from the wrapUp list interface, and match the codes. I still have a question, though: should I use the "count" stat to get the final count of each WrapUp? If so, I could filter down the metrics to, say "tHandle", right?

    Thank you!

    { "group": { "mediaType": "voice", "wrapUpCode": "7de124cd-42a0-4898-9d3c-11002876b43f" }, "data": [ { "interval": "2017-06-21T03:00:00.000Z/2017-06-22T03:00:00.000Z", "metrics": [ { "metric": "tAcw", "stats": { "max": 43000, "count": 8, "sum": 86000 } }, { "metric": "tHandle", "stats": { "max": 418676, "count": 8, "sum": 1473979 } }, { "metric": "tTalkComplete", "stats": { "max": 418676, "count": 8, "sum": 1387979 } } ] } ] }


    tim.smith | 2017-06-21 19:56:52 UTC | #6

    Using the count value is correct for your purpose. I would recommend using tAcw based on the way it's calculated; there will be a 1:1 relationship between ACW events and having a wrap up code assigned for the participant. There are scenarios that will cause other metrics to be counted more than once per participant. You can select which metrics to return by specifying the metrics array in your query like this:

     "metrics": [
      "tAcw"
     ]

    Note: If there is no data for a statistic, it will not be returned in the response regardless of if it was requested.


    dkprado | 2017-06-21 19:56:28 UTC | #7

    Excellent! Thank you very much Tim!


    system | 2017-07-22 19:56:32 UTC | #8

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 1450