Tim is correct that this capability does not currently exist in architect. It is possible to create a custom PureCloud Integration action to get at some of this data. Please read this whole post, there are some major limitations.
Figuring out if there are no agents logged into a queue is pretty safe. The following contracts and configuration will return how many users are active in a queue by checking the status of all members of the queue. You can find the queue_id for a queue by going to the queue in the admin UI and grabbing the ID from the URL, it is a GUID that will be formatted like this "225b0345-2ae8-4de8-8b3b-d44c1cb57921". If this action returns 0 then you can be sure that there are no agents currently logged into the queue. A value > 0 indicates that there are agents on-queue, but there are a lot of reasons why the call might not be answered, like agents not having required skills or agents logging out of the queue.
Input Contract
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Get Number of Agents Logged Into Queue Request",
"description": "A user ID-based request.",
"type": "object",
"required": [
"QueueID"
],
"properties": {
"QueueID": {
"type": "string",
"description": "The Queue ID."
}
}
}
Output Contract
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Get User Routing Status Response",
"description": "Agents logged into queue.",
"type": "object",
"required": [
"Agents Logged Into Queue"
],
"properties": {
"Agents Logged Into Queue": {
"type": "number",
"title": "Agents",
"description": "Agents logged into queue. A value > 0 does not guarentee that an interaction sent to this queue will be answered."
}
}
}
Request Configuration
{
"requestUrlTemplate": "/api/v2/routing/queues/${input.QueueID}/users?presence=$esc.url('On Queue')",
"requestType": "GET",
"headers": {},
}
Response Contract
{
"translationMap": {
"Agents_Logged_Into_Queue": ".total"
},
"successTemplate": "{\n \"Agents Logged Into Queue\": {Agents_Logged_Into_Queue}\n}"
}
If you want to dig into the details of agents on the queue there is a different way to use the API. Instead of using agent presence you can check on agent routing status. For example, this should return the number of agents who are on-queue and not on any type of interaction:
/api/v2/routing/queues/${input.QueueID}/users?routingStatus=IDLE
Routing Statues are described in this article:
https://developer.mypurecloud.com/api/rest/v2/presence/understanding_presence.html
I talked with the developers behind this, and they cautioned that it is critical that you have a fallback plan for your queues. The stats are for a point of time, not a guarantee that the queue will still be in the same state by the time a call is transfered there.
Another note, these APIs are not necessarily very scalable. There could be issues using them with big/busy queues, and are absolutely not appropriate for driving wallboards. Consider this at best a stop-gap until Architect includes first class support for this use case with PURE-938.