cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2190
Views
10
Helpful
4
Replies

UCCX 12.5.1 Expression editor format for API Rest/POST call to Epic

jeremyseielstad
Level 1
Level 1

I am trying to pass Json variables using a POST through the body and can not seem to apply the format body fields in a way that UCCX editor will allow.  

 

In tests using Postman we were able to make the POST with the following string in the body as raw output

 

{"Context":"scheduling","UserID":"mruiz2","ContactType":"Incoming","CommunicationType":"Phone","PhoneNumber":"9876543210","PatientID":{"ID":"","Type":""}}

 

When we try to use this in UCCX editor we get parsing errors.  Any help with formatting this correctly would be greatly appreciated.

I am a noob sorry these questions are stupid.Capture.PNG

1 Accepted Solution

Accepted Solutions

jeremyseielstad
Level 1
Level 1

My Manager found this thread and it seems to work so far.

 

https://community.cisco.com/t5/contact-center/uccx-rest-call-post-json-body/m-p/4308330

 

The last post in that thread is the one I followed.

 

"{'serverName': 'myServer.domain.com'}"
"{'serverName': 'myServer.domain.com','serverId' : 1,'dnis': "+ CalledNumber +", 'queue': '"+ CSQ +"'}"
Object name has to be in single qoutes

For string variable in your json use '"+ variableName + "' (single and double qoute in beginning and double and single in the end)

For int variable in your json use "+ variableName + " (double qoute in beginning and double in the end)

Static values just single for string and for int only value

 

 

I will update again once I have validated that the script actually works.

View solution in original post

4 Replies 4

Jonas Fraga
Spotlight
Spotlight

Hello @jeremyseielstad 

I've found some format issues that could be the cause. I've used a JSON Formatter website and fixing the sintax errors I've found the following result:

{"Context":"scheduling","UserID":"RESTUID","ContactType":"Incoming","CommunicationTy":{"Context":"scheduling"},"pe":"Phone","P":{"Context":"scheduling"},"honeNumber":"CallerID","PatientID":{"ID":"","Type":""}}

 

Captura de Tela 2021-07-08 às 14.57.37.png

 

Just let me know if this passes on CCX Editor and mark as solved this post if so.

Thanks.

Thank you for your response my first post was formatted incorrectly .

Her is what it should have read.

{"Context":"scheduling","UserID":"mruiz2","ContactType":"Incoming","CommunicationType":"Phone","PhoneNumber":"9876543210","PatientID":{"ID":"","Type":""}}

 

In any case I tried the result you sent me and it did not pass either.  It keeps getting hung op on or after the colon at character 33 in the string.

Thank you for the reply I did have it formatted incorrectly.  The following is what I should have posted...

 

{"Context":"scheduling","UserID":"mruiz2","ContactType":"Incoming","CommunicationType":"Phone","PhoneNumber":"9876543210","PatientID":{"ID":"","Type":""}}

 

 

In any case I tried your result and am getting the same error.  It appears to not like the syntax at or just after the colon at character 33.

 

Thank again.

jeremyseielstad
Level 1
Level 1

My Manager found this thread and it seems to work so far.

 

https://community.cisco.com/t5/contact-center/uccx-rest-call-post-json-body/m-p/4308330

 

The last post in that thread is the one I followed.

 

"{'serverName': 'myServer.domain.com'}"
"{'serverName': 'myServer.domain.com','serverId' : 1,'dnis': "+ CalledNumber +", 'queue': '"+ CSQ +"'}"
Object name has to be in single qoutes

For string variable in your json use '"+ variableName + "' (single and double qoute in beginning and double and single in the end)

For int variable in your json use "+ variableName + " (double qoute in beginning and double in the end)

Static values just single for string and for int only value

 

 

I will update again once I have validated that the script actually works.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: