Hello,
I'm trying to create a data action that searches for all users with a given skill and their proficiency with that skill to build and agent-pair list for preferred agent routing. We were able to get the list of users based on the skill but pulling their proficiency in that skill is eluding me. Here is the API call we are using-
/api/v2/users/search
The Request Body Template is coded like this-
{
"sortOrder": "ASC",
"sortBy": "id",
"pageSize": 500,
"pageNumber": 1,
"expand": ["skills"],
"query": [
{
"value": "${input.Skill}",
"fields": [
"routingSkills.name"
],
"type": "EXACT"
}
]
}
The Response is coded like this (which I suspect is part of the issue)-
{
"translationMap": {
"proficiency": "$..skills.[?(@.name==\"PSI General\")].proficiency",
"id": "$.results[*].id"
},
"translationMapDefaults": {
"proficiency": "\"[]\"",
"id": "\"[]\""
},
"successTemplate": "${id}"
}
The Output Contract JSON looks like this-
{
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"additionalProperties": true
}
},
"undefined": {
"type": "object",
"properties": {
"results.skills": {
"type": "array",
"items": {
"title": "proficiency",
"type": "string"
}
}
},
"additionalProperties": true
}
},
"additionalProperties": true
}
And the Simple screenshot-
When I run this I get the error-
11. Validate output against schema: JSON failed output schema validation for the following reasons: instance type (array) does not match any allowed primitive type (allowed: ["object"])
I believe the error is generated due to the Response coding but in trying to correct it, I've gotten nothing to return. Any clue on how I can fix this and get it to return the userID and their Proficiency for the skill I'm searching in the API call?