cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1586
Views
0
Helpful
5
Replies

Problems With UCCX Script

BPaz
Level 1
Level 1

Good afternoon Cisco Voice Experts and cisco community members.

 

I'm new in cisco uccx scripting, so my problem is probably a little thing that I don't see very quickly in this moment.

 

Well, i'm trying to make a rest call and I have success, to see that example i put this image:

 

HTTP 200 Code ResponseHTTP 200 Code Response

As you can see, the server is answer me with a bunch of parameters. At this point my difficulties appear, when I tried to take the information that I need, I don't know how to do it. Because this server is answer me in a Json Format. My Cisco UCCX version is 10.6, 'cause that reason it doesn't support natively Json answers.

 

UCCX XML ExceptionUCCX XML Exception

 

This script is a test before a local service that we're going to develop, so I do this to know how to do it with an open alternative.

 

So, my questions are the following:

 

1.- ¿Do I need to develop a Java procedure for take the information that I need? For this test, I need to call the city name, only for develop a quick test.

2.- ¿Is better to develop a SOAP request or have a REST API for this Cisco UCCX Version?

 

Thanks for your help and atention.

5 Replies 5

Anthony Holloway
Cisco Employee
Cisco Employee
Well, you are receiving JSON, but using the Get XML Document Data step. If you're on UCCX 11.6(1), you'll need to switch to the Get JSON Document Data step instead. Alternatively, if you don't want to use that step, or cannot because of your version, then you'll need to parse the String with some string methods, or Regular Expressions.

Hi Anthony, thanks for your response and attention.

 

In this case, we're using Cisco UCCX v10.6. I read in some posts the possibility of do this more easy in cisco UCCX 11.6 version... However, this is not the case.

 

Could you give me some advice how to parse or take that information with java or regular expressions? I'm not good with java, but i'll do an effort with regular expressions.

 

If it's useful, I put a copy of my script in this answer.

 

Thanks in advance for your help.

Actually, you'll need to write Java to use Regular Expressions. It's actually easier with 11.6(1) because you get the native JSON data handling right in the script.

If you still want to use Regular Expressions, I don't have the time to write the solution for you, but I can give you a little push in the right direction.

See this post of mine from a while back on how I used Regex in my script (and someone else posted a script example):
https://supportforums.cisco.com/t5/contact-center/regular-expression-in-a-script/td-p/1402949

See this post online for a tutorial on how to use Regex in Java:
https://www.tutorialspoint.com/java/java_regular_expressions.htm

Good Night Anthony, aplogize me my late answer... First, I want to thank you for youyr help and attention.

 

I was trying to do what you recommend me and i have a good result...

 

But now, I have this situation:

 

Since my last comment in this post, i changed my script for my final project:

Image 1: Changes to the ScriptImage 1: Changes to the Script

I'm able to send a POST to by the Rest Call to my web service with json. My Rest Call POST is the following:

 

Image 2: Rest Call POSTImage 2: Rest Call POST

When my variable "String_Body" is the following sentence, everything is OK: u"{\"peticion\":{\"identidad\": \" 08011985xxxxx \",\"tipoconsulta\":\"M\",\"tarjeta\":\"4444555566667777\"}}"

Image 3: Debugging ScriptImage 3: Debugging Script

But I can´t include in my variable "String_Body" the variables "String_CreditCard" and "String_IDNo". For send any value for that fileds in my WebService...

 

My questions are: ¿How I can include that variables (String_CreditCard and String_IDNo) into my variable String_Body that able me to any value? ¿Am I doing a bad use for the correct syntax to replace the value of those variables into my String_Body variable?

 

Thanks for your help...

Jimmy5
Cisco Employee
Cisco Employee

Good to know this. regarding JSON, I was facing some issue. so I used JSON Formatter to resolve that.