Hello,
I would like to know if it is possible to count the number of IDLE agents based on a Data Action.
I use the /api/v2/routing/queues/{input.queue_id}/users?skills={input.skill}&routingStatus=${input.status} to retrieve the user information from the queue based on the Queue ID, the Skill and the status (Idle in this case).
The Data Action runs and I get a result in JSON, but I would like to count the status Idle so that when I have a value >0 then I can route that call via a pre-call rule to an Outbound Preview agent and if the value is =<0 I mark the contact in the list to not call.
Can I fetch or count the number of "status": Ïdle" from the data actions results?
I have been trying all day now and I can't get it to work like I want to.
JSON used:
{
"name": "test_GetAgentsIdleFromQueue - Exported 2020-08-20 @ 16:40",
"integrationType": "purecloud-data-actions",
"actionType": "custom",
"config": {
"request": {
"requestUrlTemplate": "/api/v2/routing/queues/{input.queue_id}/users?skills={input.skill}&routingStatus={input.status}",
"requestType": "GET",
"headers": {
"Content-Type": "application/json"
},
"requestTemplate": "{input.rawRequest}"
},
"response": {
"translationMap": {},
"translationMapDefaults": {},
"successTemplate": "${rawResult}"
}
},
"contract": {
"input": {
"inputSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Queue Request",
"description": "Requests Queue",
"type": "object",
"required": [
"queue_id"
],
"properties": {
"queue_id": {
"description": "The Queue ID",
"type": "string"
},
"skill": {
"type": "string"
},
"status": {
"type": "string"
}
},
"additionalProperties": true
}
},
"output": {
"successSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Result",
"description": "Returns the number of idle agents.",
"type": "object",
"properties": {
"routingStatus": {}
},
"additionalProperties": true
}
}
},
"secure": false
}
Best regards,
Rob