i have imported the json, thanks for the feedback.
the API is reponding with interacting and idle, is there a way i can expand to include all routing statuses and prescens details?
Original Message:
Sent: 07-15-2025 09:50
From: Jan Heinonen
Subject: Agent availability - /api/v2/analytics/queues/observations/query
Hello Nadir,
There is an example you can use in AppFoundry if you search for "data action".
You can save this as .json and import it
{ "name": "Get queue info", "integrationType": "purecloud-data-actions", "actionType": "custom", "config": { "request": { "requestUrlTemplate": "/api/v2/analytics/queues/observations/query", "requestType": "POST", "headers": { "Content-Type": "application/json", "UserAgent": "PureCloudIntegrations/1.0" }, "requestTemplate": "{\n \"filter\": {\n \"type\": \"or\",\n \"predicates\": [\n {\n \"type\": \"dimension\",\n \"dimension\": \"queueId\",\n \"operator\": \"matches\",\n \"value\": \"${input.queueId}\"\n }\n ]\n },\n \"metrics\": [\n \"oOnQueueUsers\"\n ]\n}" }, "response": { "translationMap": { "statuses": "$.results[0].data..qualifier", "counts": "$.results[0].data..stats.count" }, "translationMapDefaults": { "statuses": "[\"Error\"]", "counts": "[0]" }, "successTemplate": "{\"counts\": ${counts}, \"statuses\": ${statuses}}" } }, "contract": { "input": { "inputSchema": { "type": "object", "required": [ "queueId" ], "properties": { "queueId": { "default": "", "type": "string" } }, "additionalProperties": true } }, "output": { "successSchema": { "type": "object", "properties": { "counts": { "description": "Integer array of on queue agent counts for each routing status. Wrap this variable in a sum() expression to get the total number of on queue agents.", "type": "array", "items": { "type": "integer" } }, "statuses": { "description": "String array of on queue agent routing statuses for matching up to the counts array.", "type": "array", "items": { "type": "string" } } }, "additionalProperties": true } } }, "secure": false}
------------------------------
Jan Heinonen
Contact Center Specialist
GlobalConnect AB
Original Message:
Sent: 07-14-2025 14:14
From: Nadir Isaacs
Subject: Agent availability - /api/v2/analytics/queues/observations/query
hi all
I would like to create a data action in cloud and require some guidance on the following API: /api/v2/analytics/queues/observations/query
Request type: POST
Purpose: feed in the Queue ID and return the count of agents on each presence
Request: We would like to call the API /api/v2/analytics/queues/observations/query as a data action in the architect flow and route based on the total number of agents on each presences
example response, required parameters on bold:
request body template:
{"filter":{"type":"or","predicates":[{"type":"dimension","dimension":"queueId","operator":"matches","value":"734d14ed-e438-4fb3-ab60-119a22d08227","range":{}}]},"detailMetrics":["oOnQueueUsers"],"metrics":["oAlerting","oInteracting","oOffQueueUsers","oMemberUsers","oOnQueueUsers","oUserRoutingStatuses","oUserPresences","oWaiting"]}
{
"systemToOrganizationMappings": {
"ON_QUEUE": [
"e08eaf1b-ee47-4fa9-a231-1200e284798f"
],
"MEAL": [
"3fd96123-badb-4f69-bc03-1b1ccc6d8014"
],
"AVAILABLE": [
"6a3af858-942f-489d-9700-5f9bcdcdae9b"
],
"OFFLINE": [
"ccf3c10a-aa2c-4845-8e8d-f59fa48c58e5"
]
},
"results": [
{
"group": {
"queueId": "734d14ed-e438-4fb3-ab60-119a22d08227",
"mediaType": "voice"
},
"data": [
{
"metric": "oInteracting",
"stats": {
"count": 3
}
}
]
},
{
"group": {
"queueId": "734d14ed-e438-4fb3-ab60-119a22d08227"
},
"data": [
{
"metric": "oActiveUsers",
"stats": {
"count": 39
}
},
{
"metric": "oOnQueueUsers",
"qualifier": "INTERACTING",
"stats": {
"count": 3
}
},
{
"metric": "oOnQueueUsers",
"qualifier": "IDLE",
"stats": {
"count": 3
}
},
{
"metric": "oUserPresences",
"qualifier": "e08eaf1b-ee47-4fa9-a231-1200e284798f",
"stats": {
"count": 6
}
},
{
"metric": "oUserPresences",
"qualifier": "3fd96123-badb-4f69-bc03-1b1ccc6d8014",
"stats": {
"count": 2
}
},
{
"metric": "oUserPresences",
"qualifier": "6a3af858-942f-489d-9700-5f9bcdcdae9b",
"stats": {
"count": 4
}
},
{
"metric": "oUserPresences",
"qualifier": "ccf3c10a-aa2c-4845-8e8d-f59fa48c58e5",
"stats": {
"count": 27
}
}
]
},
{
"group": {
"queueId": "734d14ed-e438-4fb3-ab60-119a22d08227",
"mediaType": "video"
},
"data": [
{
"metric": "oInteracting",
"stats": {
"count": 0
}
}
]
},
{
"group": {
"queueId": "734d14ed-e438-4fb3-ab60-119a22d08227",
"mediaType": "message"
},
"data": [
{
"metric": "oInteracting",
"stats": {
"count": 0
}
}
]
},
{
"group": {
"queueId": "734d14ed-e438-4fb3-ab60-119a22d08227",
"mediaType": "email"
},
"data": [
{
"metric": "oInteracting",
"stats": {
"count": 0
}
}
]
},
{
"group": {
"queueId": "734d14ed-e438-4fb3-ab60-119a22d08227",
"mediaType": "callback"
},
"data": [
{
"metric": "oInteracting",
"stats": {
"count": 0
}
}
]
},
{
"group": {
"queueId": "734d14ed-e438-4fb3-ab60-119a22d08227",
"mediaType": "chat"
},
"data": [
{
"metric": "oInteracting",
"stats": {
"count": 0
}
}
]
}
]
}
Please kindly assist with an input contract for the data /api/v2/analytics/queues/observations/query.
current contract:



regards
nadir isaacs
#DataActions
#Integrations
------------------------------
Nadir Isaacs
Specialist
------------------------------