question

Rob DiCecco avatar image
Rob DiCecco asked Rob DiCecco commented

How do we get results from the assorted call log & analytic APIs that tie out with the Performance Reports in the UI?

I've been beating my head against the wall trying to tie out data from the API to our UI performance reports to no avail. Whether I look at the Timeline data, the Aggregate (queue) data, or the Detailed Call Logs, I can't ever seem to get the same answer via the API that I see in the interface. Even going so far as looking at a single call (Session ID) and comparing that to the call details in the Performance Report, I see different durations in the API returned call data from what appears in the UI.

For this example, I'll focus on just the aggregation fetch, summarized at the queue level vs. the Queue view in the Performance Report for a single queue. Even putting aside duration, I don't see the same call counts. Filtering the Performance Report to 9/13 and focusing on the Advanced Solutions Team (one of our queues,) the Performance Report shows 67 inbound calls, 62 answered, with 5 abandons, 23 holds, 11 refused calls and a 92.5% Service Level. The API JSON return shows – 66 inbound calls, 62 answered calls (one thing that matches,) 14 abandoned calls, 23 calls placed on hold (the other item that matches,) and 62 calls within Service Level & 4 out of service level. Interestingly, 62 calls in SL out of 66 total, would be a 93.9% Service Level while 62 calls within Service Level out of the total shown in the UI of 67 would in fact be a 92.5% service level.

I've included a screenshot of the UI Performance Report I'm using below. The API call and the relevant portion of the JSON response are below as well. What on earth am I doing / interpreting wrong?

API Call -

URI - https://platform.ringcentral.com/analytics/calls/v1/accounts/~/aggregation/fetch?page=1&perPage=200

Body:

{

"grouping": {

"groupBy": "Queues"

},

"timeSettings": {

"timeRange": {

"timeFrom": "2022-09-14T04:00:00.000Z",

"timeTo": "2022-09-15T03:59:00.000Z"

},

"timeZone": "America/New_York"

},

"callFilters": {

"directions": [

"Inbound"

]

},

"responseOptions": {

"counters": {

"allCalls": {

"aggregationType": "Sum"

},

"callsByDirection": {

"aggregationType": "Sum"

},

"callsByOrigin": {

"aggregationType": "Sum"

},

"callsByResponse": {

"aggregationType": "Sum"

},

"callsSegments": {

"aggregationType": "Sum"

},

"callsByResult": {

"aggregationType": "Sum"

},

"callsByQueueSla": {

"aggregationType": "Sum"

},

"callsByActions": {

"aggregationType": "Sum"

},

"callsByType": {

"aggregationType": "Sum"

}

},

"timers": {

"allCallsDuration": {

"aggregationType": "Sum"

},

"callsDurationByDirection": {

"aggregationType": "Sum"

},

"callsDurationByOrigin": {

"aggregationType": "Sum"

},

"callsDurationByResponse": {

"aggregationType": "Sum"

},

"callsSegmentsDuration": {

"aggregationType": "Sum"

},

"callsDurationByResult": {

"aggregationType": "Sum"

},

"callsDurationByQueueSla": {

"aggregationType": "Sum"

},

"callsDurationByType": {

"aggregationType": "Sum"

}

}

}

}

JSON Response for the Advanced Solutions Team:

{

"key": "466272027",

"info": {

"extensionNumber": "835",

"name": "Advanced Solutions Team"

},

"timers": {

"allCalls": {

"valueType": "Seconds",

"values": 24336.79

},

"callsByDirection": {

"valueType": "Seconds",

"values": {

"inbound": 24336.79,

"outbound": 0

}

},

"callsByOrigin": {

"valueType": "Seconds",

"values": {

"internal": 817.415,

"external": 23519.375

}

},

"callsByResponse": {

"valueType": "Seconds",

"values": {

"answered": 24034.051,

"notAnswered": 302.739,

"connected": 0,

"notConnected": 0

}

},

"callsSegments": {

"valueType": "Seconds",

"values": {

"ringing": 3762.024,

"liveTalk": 14263.727,

"hold": 7451.89,

"park": 0,

"transfer": 212.3,

"ivrPrompt": 0,

"voicemail": 43.445,

"vmGreeting": 11.307,

"setup": 8.798

}

},

"callsByResult": {

"valueType": "Seconds",

"values": {

"completed": 19045.405,

"abandoned": 5040.912,

"voicemail": 250.473,

"missed": 0,

"accepted": 0,

"unknown": 0

}

},

"callsByQueueSla": {

"valueType": "Seconds",

"values": {

"inSla": 24034.051,

"outOfSla": 302.739

}

},

"callsByType": {

"valueType": "Seconds",

"values": {

"direct": 0,

"fromQueue": 20188.136,

"parkRetrieval": 0,

"transferred": 4148.654,

"outbound": 0

}

}

},

"counters": {

"allCalls": {

"valueType": "Instances",

"values": 66

},

"callsByDirection": {

"valueType": "Instances",

"values": {

"inbound": 66,

"outbound": 0

}

},

"callsByOrigin": {

"valueType": "Instances",

"values": {

"internal": 3,

"external": 63

}

},

"callsByResponse": {

"valueType": "Instances",

"values": {

"answered": 62,

"notAnswered": 4,

"connected": 0,

"notConnected": 0

}

},

"callsSegments": {

"valueType": "Instances",

"values": {

"ringing": 144,

"liveTalk": 62,

"hold": 23,

"park": 0,

"transfer": 11,

"ivrPrompt": 0,

"voicemail": 1,

"vmGreeting": 1,

"setup": 14

}

},

"callsByResult": {

"valueType": "Instances",

"values": {

"completed": 51,

"abandoned": 14,

"voicemail": 1,

"missed": 0,

"accepted": 0,

"unknown": 0

}

},

"callsActions": {

"valueType": "Instances",

"values": {

"parkOn": 0,

"parkOff": 0,

"holdOn": 14,

"holdOff": 0,

"blindTransfer": 0,

"warmTransfer": 8,

"dtmfTransfer": 0

}

},

"callsByQueueSla": {

"valueType": "Instances",

"values": {

"inSla": 62,

"outOfSla": 4

}

},

"callsByType": {

"valueType": "Instances",

"values": {

"direct": 0,

"fromQueue": 58,

"parkRetrieval": 0,

"transferred": 8,

"outbound": 0

}

}

}

}

1663881438114.png

analytics and reporting
1663881438114.png (162.8 KiB)
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Rob DiCecco commented

It is so hard to read your question. No paragraphs.

All I could easily see is the different time range between the comparations.

From your API call

"timeSettings": {

"timeRange": {

"timeFrom": "2022-09-14T04:00:00.000Z",

"timeTo": "2022-09-15T03:59:00.000Z"

},

"timeZone": "America/New_York"

},


And from your UI dash board

screen-shot-2022-09-23-at-71110-am.png


I don't know how you expect to see the same result.


5 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Rob DiCecco avatar image Rob DiCecco commented ·

Thanks Phong, keen eye :) You are right, the date shown in my sample is wrong, it's actually from a later run testing to see if a different day got any closer (it didn't.) The call that returned the sample response JSON is for the correct date -

"timeSettings" : {
"timeRange" : {
"timeFrom" : "2022-09-13T04:00:00.000Z" ,
"timeTo" : "2022-09-14T03:59:00.000Z" }

...


The API requires Zulu time (at least as I understand it) hence the peculiar 04:00:00.000 thing.




0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Rob DiCecco commented ·

I think the UI dashboard detects and uses your local time zone set in your computer. You use that time zone in the API call to make sure that the date and time ranges are the same.

0 Likes 0 ·
Rob DiCecco avatar image Rob DiCecco Phong Vu ♦♦ commented ·

I've tried that adjusting the stated time range in the API call too, to no avail.

Even if I change the call to reflect -

"timeSettings" : {
"timeRange" : {
"timeFrom" : "2022-09-13T00:00:00.000Z" ,
" timeTo" : "2022-09-13T23:59:00.000Z" },
"timeZone" : "America/New_York"
}


I get exactly the same results (we don't really get any call volume at the extreme fringes of the day anyway.)

I tried to copy-paste the response here, but it won't let me even once I edit it for length...


0 Likes 0 ·
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys