cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1211
Views
0
Helpful
8
Replies

Can I get the current state of all WxCC agents

Sascha Monteiro
Level 6
Level 6

i.e. if I start my app and subscribe to agent webhooks I don't know what state they are in, listing all activities from /v1/agents/activities doesn't seem very usable as I don't know how far back I need to go

1 Accepted Solution

Accepted Solutions

This has since been fixed - using AgentSession is the way to get the latest states.

https://github.com/CiscoDevNet/webex-contact-center-api-samples/blob/main/graphql-sample/allAgentSessionFields.graphql

Along with isActive

isActive 

View solution in original post

8 Replies 8

Wouldn't this be better handled by a subscription to events? You will still not know their state, but over time you'll get everyone's current state.

david

yeah, I do that, but it can take hours or days if the agent has no new events, and if I i.e. restart my app or it's offline for maintenance I may miss events and agents may be reported incorrectly

Is there a reason you couldn't use an analyzer report for this? Is there a business case where you need to look at it directly vs. the GUI for instance?

we are developing wallboards with queue & agent stats that go on TV's etc

Arunabh Bhattacharjee
Cisco Employee
Cisco Employee

Today there are a few unfinished items in the below API for agentSession, as it is still early beta - however you should be able to

 
curl --location --request POST 'https://api.wxcc-us1.cisco.com/search?orgId=1c71287f-2f41-458b-b101-c4e616123554' \

--header 'Authorization: Bearer yourToken' \

--header 'Content-Type: application/json' \

--data-raw '{"query":"{\n # Agent Session \"All Fields\" example - Gets all the Agent Session fields - All fields in the ASR\n agentSession(from: 1658965592151, to: 1660845638003, \n filter: {isActive: {equals: true}}) {\n agentSessions {\n agentId\n userLoginId\n agentName\n agentSessionId\n isActive\n startTime\n endTime\n teamId\n teamName\n siteId\n siteName\n channelInfo {\n totalDuration\n channelId\n agentToAgentTransferCount\n agentTransferToQueueRequestCount\n availableCount\n blindTransferCount\n channelId\n channelType\n connectedCount\n consultAnswerCount\n consultAnswerDuration\n consultRequestCount\n consultRequestDuration\n consultToQueueAnswerCount\n consultToQueueAnswerDuration\n consultToQueueCount\n consultToQueueDuration\n consultToQueueRequestCount\n consultToQueueRequestDuration\n disconnectedCount\n disconnectedHoldCallsCount\n holdCount\n holdDuration\n idleCount\n idleDuration\n notRespondedCount\n notRespondedDuration\n outdialAgentToAgentTransferCount\n agentTransferToQueueRequestCount\n outdialBlindTransferCount\n outdialConferenceCount\n outdialConferenceDuration\n outdialConnectedCount\n outdialConnectedDuration\n outdialConsultAnswerCount\n outdialConsultAnswerDuration\n outdialConsultCount\n outdialConsultDuration\n outdialConsultRequestCount\n outdialConsultRequestDuration\n outdialCount\n outdialConsultToQueueAnswerCount\n outdialConsultToQueueAnswerDuration\n outdialConsultToQueueRequestCount\n outdialConsultToQueueRequestDuration\n outdialHoldCount\n outdialHoldDuration\n outdialNotRespondedCount\n outdialNotRespondedDuration\n outdialRingingCount\n outdialRingingDuration\n outdialTransferCount\n outdialWrapupCount\n outdialWrapupDuration\n ringingCount\n ringingDuration\n subChannelType\n availableDuration\n conferenceDuration\n connectedDuration\n consultAnswerDuration\n consultDuration\n consultRequestDuration\n consultToQueueAnswerDuration\n consultToQueueDuration\n consultToQueueRequestDuration\n holdDuration\n idleDuration\n notRespondedDuration\n outdialConferenceDuration\n outdialConnectedDuration\n outdialConsultAnswerDuration\n outdialConsultDuration\n outdialConsultRequestDuration\n outdialConsultToQueueAnswerDuration\n outdialConsultToQueueRequestDuration\n outdialHoldDuration\n outdialNotRespondedDuration\n outdialRingingDuration\n outdialWrapupDuration\n ringingDuration\n wrapupDuration\n transferCount\n wrapupCount\n }\n }\n }\n}","variables":{}}'

This has since been fixed - using AgentSession is the way to get the latest states.

https://github.com/CiscoDevNet/webex-contact-center-api-samples/blob/main/graphql-sample/allAgentSessionFields.graphql

Along with isActive

isActive 

Sascha Monteiro
Level 6
Level 6

thanks, I can get results if I leave state out, but this still requires the agent to have a state change within this from-to period?

So this gives you the details of the agent session at that point in time, when you filter for active sessions

A session spans from a login to logout. One session record per logged in session for that agent
The state field will give you the state at that point in time when you make the request

For all past sessions you will see the state as logged-out

Let us know if you have any questions
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: