05-25-2023 12:57 AM
I'm working on a uccx script that initiate Make Rest Call with Post and Body content to pass Metadata. I use a variable to place my syntax i test working successfully in Postman. However, when im about to put in on the uccx variable i declare in the script im getting error "Unable to Parse expression; Couldn't repair and continue parsing on toke #ID 'acdServerId'(line:1, col:4). Take note i followed recommended from other forum using single quote instead of double quote but im getting 400 bad request.
Hoping someone can share insight how i can properly correct the syntax.
Postman Request Body - working successfully.
"{"acdServerId": "7", "acdId": "variable1", "metadata": [{"name": "queue-name-key", "value": "variable2"}]}"
UCCX script - getting error
05-26-2023 08:22 AM
05-29-2023 12:46 AM
05-29-2023 12:56 PM
Ok, this is good though that means that your request step is correct and you just need to get the format of the string. Can you post the variable string you're trying to use that fails?
david
05-30-2023 12:14 AM
06-01-2023 06:03 AM
Ok so I've done something very similar for SFDC.
1. Have a string variable which captures the format of your JSON I call mine caseTemplate. U"{\"BotId__c\":\"4600\",\"Status\":\"New\",\"CallType__c\":\"Equipment\",\"RecordTypeId\":\"0121U00GJ\",\"Origin\":\"IVR\",\"CSTProblemReported__c\":\"Move On Location\",\"AccountId\":\"%1s\",\"Description\":\"David Macias UCCX\",\"Subject\":\"Move On Location\",\"Priority\":\"3\"}"
Notice the %1s after AccountId, I'll be setting this dynamically later.
2. Use a Set step to set a string with your dynamic varialble. String.format( caseTemplate, new Object[] { accountId } )
3. The end result is: "{\"BotId__c\":\"4600\",\"Status\":\"New\",\"CallType__c\":\"Equipment\",\"RecordTypeId\":\"0121U00GJ\",\"Origin\":\"IVR\",\"CSTProblemReported__c\":\"Move On Location\",\"AccountId\":\"123456\",\"Description\":\"David Macias UCCX\",\"Subject\":\"Move On Location\",\"Priority\":\"3\"}"
I hope this helps.
david
05-31-2023 04:40 AM - edited 05-31-2023 04:41 AM
I saw some discussion in the Collaboration -> Contact Center group about a similar issue. This thread talks about creating a JSON document and passing that to ServiceNow, so that might help you.
https://community.cisco.com/t5/contact-center/json-in-uccx-script/td-p/4844756
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide