Hi all,
Hoping someone has run into this issue before. We have an internal Genesys Cloud data action to search external contacts and it uses this API /api/v2/externalcontacts/organizations/{externalOrganizationId}/contacts. We are searching by q = (so doing a keyword search). We are returning Multiple string arrays. Overall this data action is working just fine.
Our issue is, when we use it in an ACD script and the agent/user searches for something and no results are found. We then get a pop-up saying 'Get Directory (BAC) : unknown error'. After the error, we can then search for a valid keyword and the script returns the array/strings as expected. So it seems to be rather benign, however our agents have reported this as an error and we would like to suppress or resolve the unknown error it throws. Developer Console in our browser shows the error below.
Could it be the ACD script when it calls the Data Action to search external contacts and an empty array is returned, is causing this error? When testing manually under Integrations -> Actions and entering in a word that has no results, I see the array returning with empty or blank values and no errors are thrown.
Browser Console Log Error:
scripter-ui--root: Scripter toast message sent {
"detail": {
"title": "",
"body": "Get Directory (BAC) : unknown error",
"severity": "error",
"hideAfter": false,
"asPlainText": false
}
}
Here is our API URL Request Template
/api/v2/externalcontacts/organizations/${input.externalOrganizationId}/contacts?q=${input.searchWord.replace(" ", "%20")}
Here is how our Response is setup:
{
"translationMap": {
"deptIdList": "$.entities[?(@.id != '')].id",
"deptList": "$.entities[?(@.id != '')].firstName",
"phoneDisplayList": "$.entities[?(@.id != '')].workPhone.display",
"nameList": "$.entities[?(@.id != '')].lastName",
"phoneE164List": "$.entities[?(@.id != '')].workPhone.e164",
"bacList": "$.entities[?(@.id != '')].middleName"
},
"translationMapDefaults": {
"deptIdList": "[]",
"deptList": "[]",
"phoneDisplayList": "[]",
"nameList": "[]",
"phoneE164List": "[]",
"bacList": "[]"
},
"successTemplate": "{\"DeptIdList\":${deptIdList},\"NameList\":${nameList},\"DeptList\":${deptList},\"PhoneDisplayList\":${phoneDisplayList},\"PhoneE164List\":${phoneE164List}, \"BacList\":${bacList}}"
}
Thanks!
Shane