Legacy Dev Forum Posts

 View Only

Sign Up

Count calls with duration time within an a specific seconds range

  • 1.  Count calls with duration time within an a specific seconds range

    Posted 06-05-2025 18:11

    leo_con | 2016-11-29 18:59:01 UTC | #1

    Hi, Please : Is it posible to get the count of calls with duration time less than 10 seconds I already tried https://api.{{environment}}/api/v2/analytics/conversations/aggregates/query with the following body to get count of call bettwen 0 and 10 seconds, but doesn't work:

    { "interval": "2016-11-15T04:00:00.000Z/2016-11-16T04:00:00.000Z", "groupBy": [ "queueId" ], "metrics": ["tTalk"] , "segmentFilters": [ { "type": "and", "predicates": [ { "dimension": "queueId", "value": "0813a84c-6975-4782-a996-ae7fb77544ad" }, { "dimension": "mediaType", "operator": "voice" }, { "dimension": "metrics", "value": "tTalk" }, { "metric": "tTalk", "range": { "gt": 0, "lte": 10000 } } ] } ] } I got always 8 calls, changing range predicate doesn't really affect the result: { "results": [ { "group": { "mediaType": "voice" }, "data": [ { "interval": "2016-11-15T04:00:00.000Z/2016-11-16T04:00:00.000Z", "metrics": [ { "metric": "tTalk", "stats": { "max": 107877, "count": 32, "sum": 852940 } } ] } ] }, { "group": { "mediaType": "voice", "queueId": "0813a84c-6975-4782-a996-ae7fb77544ad" }, "data": [ { "interval": "2016-11-15T04:00:00.000Z/2016-11-16T04:00:00.000Z", "metrics": [ { "metric": "tTalk", "stats": { "max": 85809, "count": 8, "sum": 283854 } } ] } ] } ] }

    I already asked a similar question https://developer.mypurecloud.com/forum/t/count-calls-answered-within-specific-seconds-range/597/2 and you told me "There is a new feature called "views" that will be added to the analytics APIs soon"

    Regards, Leonel


    anon47305574 | 2016-11-30 15:10:41 UTC | #2

    There's a handful of issues in your initial query and those incorrect parameters are being ignored. Specifically, segmentFilters and using metrics as dimensions to filter by are not supported.

    But yes, to your final question about "views"...that is the functionality you will be interested in.


    leo_con | 2016-11-30 15:16:36 UTC | #3

    Thank you very much Mike


    system | 2017-08-28 19:29:07 UTC | #4


    This post was migrated from the old Developer Forum.

    ref: 680