Showing results for 
Search instead for 
Did you mean: 

Calls in Q, UCCX

Dustin Peet

I know that using UCCX you cannot obtain the Calls in Queue using any of the .Queue methods built into the API as they only work in a non-coresidnet/UCCE finesse platform.  Stating the obvious, that is frustrating...  Still I find myself trying to pursue a way in which to gather the number and save it to a variable to use as I please in other parts of my javascript within the gadget.

I know that I can get get close using a get on http://uccxserver:9080/realtime/AgentCSQStats, but how can I (and this might be a dumb question, forgive me if so) just pull the string associated to the "currentWaitingCalls" property?

If there is a better way to pull the calls waiting string for a csq I'm open to anything as, admittedly, this might not be the best method.  I do not however want to pull it from LiveDataGadget.jsp as the format isn't what I'm looking for.

Thank You!

3 Replies 3

Cisco Employee
Cisco Employee

Hi Dustin,

but how can I (and this might be a dumb question, forgive me if so) just pull the string associated to the "currentWaitingCalls" property?

Do you mean from the response of the REST API (that you have shown in the screenshot), how do you get the value of currentWaitingCalls? The response is just a JSON object. Assuming you are doing this in a gadget (JavaScript), here is a useful link to explain how to parse this JSON response: How to access JSON object in JavaScript

I am not sure if you have seen these two threads yet, but I will put it here just in case you haven't: Is it possible to get realtime CSQ data from the UCCX Config API? & Finesse api queue information ?

I am not familiar with all of the stats that UCCX exposes, but it seems like your approach is probably the way to go.



Thanks Denise.  The other posts I did see prior to posting, but I couldn't find a good resource that showed how to access the data.  JSON is what I was trying to use, but I don't think I could get the syntax right.

I've followed that article and I'm getting farther but still stuck on a couple of things...

The difference for me, compared to the article, is that I need to pull from a webpage, not a local file.  So, I'm setting up the parse by using the XMLHttpRequest object.  I get a state of 4 back, but it apparently can't parse correct, as the next two fields that I try to place parsed data into, end up empty.  Attached is the section of code I'm using to pull down the data and then parse it.

What else I've noticed too, is that on the first browser (firefox) I continuously see a state of '1' even after making changes, reuploaded, clearing browser cache and appending ?nocache to the url.  I thought I had this right, so I tried in IE instead and it pulled a '4' right away (for state).  So despite my attempts to clear everyone from the browser, it (or the server) seems like its still holding onto the session.  Is there a different way to clear that so each attempt is a new session creation?

I've also cycled through several of the ways in which to get the returned string as they are demonstrated on the suggested site.  I've even set it to a variable and placed the variable inside the .text method, but that still doesn't work.  What you see in the screenshot is just the last attempt of a format change.  This leads me to believe that the JSON.parse function is where the error is.  I just don't know where the syntax is incorrect.

Hi Dustin,

Did you make sure that queueData.responseText is correct? Looking at your response from your very first image, the response body starts with [ ] while the JSON from the link is {}, so you might need to parse out the [] before you send it to JSON.parse.

Is there a different way to clear that so each attempt is a new session creation?

This is not a Finesse API so I do not know. GETs are usually optimize to cache.



Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers