Idle agents in Q

Based on two previous posts, I have a question on how to find the total of IDLE agents in a Q based on a non-deprecated API, as the previous questions answered both use the /api/v2/routing/queues/queueId/users API and we now should use the /api/v2/routing/queues/queueId/members API.

I find however that this API doesn't return the total of agents in an idle status with the same parameters and I can't figure out what to add to get the total of available agents

previously it was:
GET /api/v2/routing/queues/e10ca16a-34ea-41ec-bcdf-ac834ed19ebe/users?expand=routingStatus&routingStatus=IDLE HTTP/1.1

Using:
GET /api/v2/routing/queues/e10ca16a-34ea-41ec-bcdf-ac834ed19ebe/members?expand=routingStatus&routingStatus=IDLE HTTP/1.1

doesn't yield the same result. What do I miss?

Hello,

There is no total attribute returned in the new endpoint.
See Deprecating /api/v2/routing/queue/{id}/users endpoints, replacing with alernatives

You'll have to count the number of elements in the "entities" attribute (if your result stands in a single result page), or make the sum of elements in the "entities" attribute returned by different calls to this endpoint (if you need to do paging).

Regards,

I don't find that a very helpful change, especially not when not being an expert in API coding, how do I go about that?

most users don't actually need the total count of users in a given state. they just want to know if there are any versus if there are none.

it's quite common in paging APIs to not include totals in each page's response. calculating totals is very expensive and to include that in the response requires querying / scanning the entire data set as part of each and every page request.

OK, still my question stands, how do I count them? The provided responses on the thread didn't help me and I can't access the APP foundry solution

Hello,

My questions would then be: where and when do you need to do this check on IDLE agents?
Are you trying to get this number in an Architect flow, from a Script exposed to the Agent, via an integrated client application (webapp displayed in Genesys Cloud Desktop)?
As you mention javascript SDK, I would tend to think that you may be looking for a custom webapp (integrated client application). But I don't know for sure. And I don't know if your question is just about adding a request to this API endpoint in your code (part of an existing piece of code you have). In Javascript. Or if it goes beyond that.
Your initial post made me think you were able to work/use the deprecated API endpoint ( /api/v2/routing/queues/queueId/users) and that you were just asking how to "migrate"/do an equivalent with the new endpoint.

Regarding your mention of AppFoundry, I am not sure I know to which solution/app you are referring to. And what you meant by can't access the appfoundry solution.

Regards,

I try to prevent dialler to place a call and then to find that on the Q there are no longer any idle agents and therefore abandoning the call. So when that call get's into the Q, we need to handle that call differently to avoid it being classed as abandoned. We currently massively breach regulations. I try to avoid dialler placing calls when there are less than x idle agents in the Q. I can use the deprecated API, but that could cause issues long term, hence I would like to do this more future proof. Yes this is done from a flow not an agent script.

Later in the post you referred too, there was mentioned an AppFoundry solution.

It sounds like you're using a power campaign that's dialing too aggressively. Presumably you've already lowered the compliance abandon rate and that wasn't sufficient. Since you have compliance guarantees that you need to meet, I would recommend using Preview or Progressive dialing to ensure you don't abandon calls.

I've just checked the post - the link to appfoundry is a set of Genesys Cloud Data Actions collection which has been made available on this site: https://appfoundry.mypurecloud.com/filter/genesyscloud/listing/13074443-4ffc-46b6-82c7-c3f4af51861f
You need to log in the AppFoundry site (this will use your Genesys Cloud username/credentials) and clicking the Get It now should lead you to a page that will start the install process (infrastructure as code).
Your user needs to have the right to execute infrastructure config job - your user needs this permission:

  • infrastructureascode:job:add

And the ones specific to this accelerator/appfoundry solution:

  • Integrations > Action > Add, Delete, Edit, Execute, and View
  • Integrations-> Integration- > View, Add and Edit

Now to get back to your original question:

I agree with Tim's recommendation if that's something you can set in place and tune.

Otherwise, as you are doing a check in an architect flow or in-queue flow, Genesys Cloud Data Action would be the way to go - so no need to go to javascript sdk coding here. You will invoke the Data Action from your Architect flow using a "Call Data Action" block.
I didn't understand if this is something you already have in place with the former endpoint. If so, this is just about using the new endpoint (and making the sum in the Data Action - see below). If not, you would create a Genesys Cloud Data Actions integration and create a Data Action for this endpoint.
One constraint with this new endpoint and Data Action is if you need to do paging (page max size is 100). But I think in your case you won't need this (assuming x is <= 100).
What I had suggested in this other post was to define a total variable in the translationMap as "total": "$.entities.size()"

One last comment as you mention outbound campaigns. I am not a specialist on this and I don't know if this can be relevant for your scenario - but as you may know, you can define Pre-Call rules (associated with a Calling List) and define conditions to dial or not a contact. The condition can also leverage your Data Action.

Regards,

Something like this for the Genesys Cloud Data Action:

Input Contract (queueId as input parameter):

{
  "type": "object",
  "required": [
    "queueId"
  ],
  "properties": {
    "queueId": {
      "type": "string"
    }
  },
  "additionalProperties": true
}

Output Contract (nIdleAgents returned):

{
  "type": "object",
  "properties": {
    "nIdleAgents": {
      "type": "integer"
    }
  },
  "additionalProperties": true
}

Request Configuration:

{
  "requestUrlTemplate": "/api/v2/routing/queues/${input.queueId}/members?expand=routingStatus&routingStatus=IDLE&pageSize=100",
  "requestType": "GET",
  "headers": {
    "Content-Type": "application/json"
  },
  "requestTemplate": "${input.rawRequest}"
}

Response Configuration:

{
  "translationMap": {
    "total": "$.entities.size()"
  },
  "translationMapDefaults": {
    "total": "0"
  },
  "successTemplate": "{\n   \"nIdleAgents\": ${total}\n}"
}

As I wrote above, the only limit here is if you need to know the exact number of idle agents when there are more than 100 idle agents.
I mean that if in your contact center, the number of idle agents is <= 100, the data action will return the exact number.
If you are more than 100 idle agents, the data action will return 100 (what's in the first page).

Regards,

Line I said I don't have the rights
image
Likely need to contact my reseller.

No. I missed some permissions in my previous post. Let me clarify that part.

This specific AppFoundry application is an "accelerator". It is a new way of deploying/defining configuration via code (infrastructure as code). When you decide to install such application, the AppFoundry site will expose a page to collect information for the deployment (if there are input values to collect like a Queue name, etc etc). And it will then invoke a Genesys Cloud service (via Platform API), on your behalf, to run the configuration job.

So your user needs to have a set of permissions to have the ability to view and to run/add such kind of jobs.
I missed two permissions yesterday.
You need:

  • infrastructureAsCode > accelerator > view
  • infrastructureAsCode > job > view
  • infrastructureAsCode > job > add

You just need to ask to the person administering your Genesys Cloud org (your Genesys Cloud Admin), to add these permissions to a Role that they will assign to your user in your Genesys Cloud org.
Once done, you'll need to logout and log back in Genesys Cloud Desktop/AppFoundry site.

There are additional permissions that your user will need to run this specific accelerator.
The permissions I mentioned above were to have the ability to run an accelerator.
The Genesys Cloud - Custom Data Actions that we are talking about also mentions it requires user to have permissions on (as the accelerator will create such type of objects in the configuration on your behalf):

  • The following permissions:
    • Integrations > Action > Add, Delete, Edit, Execute, and View
    • Integrations-> Integration- > View, Add and Edit

Regards,

You are right not set by default on the master admin role

Add permissions on infrastructureAsCode:*.*

That's what you are missing.
You can create a new role with these permissions in it and assign it to your user. Or modify an existing role if you prefer (like Master Admin) to add such permissions.

Thanks it's installed now (I'm one of the Master Admins), having a further look at your suggestions

Thanks Jerome, this has solved my query and apologies for being a nuisance.

No worries. I am glad if you have found what you were looking for.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.