cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1652
Views
10
Helpful
6
Replies

Cisco UCCX Script Editor - Allowed Characters in a Variable

ln33147
Level 4
Level 4

Dears,

We are working on a UCCX script and we need to call a REST Web Service.

One of the parameters to be passed is ($filter) and the value should be exactly as the following TicketNo eq 'xxxxxx' with 2 spaces and 2 quotes.

It seems UCCX doesn't allow using spaces, quotes and percentage characters.

Is there a way to pass these characters in the REST URL?

Any help is highly appreciated.

Thanks in advance.

 

6 Replies 6

You can't put a space in a URL. What you can do is escape that with this.

%20

A double quote should be this.

%22

A single quote would be this.

%27

Those are hex representations of the ASCII value of the character you wish to send.

https://www.asciitable.com/ 

Hello Elliot,

We tried to replace the spcae and single quote characters as you suggested but it didn't work.

The value to be passed in the Web Service URL should be TicketNo eq '1111111' 

We did replace the characters as follows TicketNo%20eq%20%271111111%27 but

UCCX is transforming the value to TicketNo%2520eq%2520%25271111111%2527. 

It seems the issue is with the percentage character.

Any suggestions?

Thanks in advance.

 

I have had to do peculiar machinations when constructing strings with characters CCX doesn't like. What I have done is get the character in question into a character value and then build the string by concatenating the variables. I forget whether it was a single or double quote, but I had one place where I needed to do that so I created a character variable called "q" with that in it and referenced it multiple times in the Set step formula.

Hello Elliot,

With the Set Step we can add spaces to a variable. However, the issue is with the "Make Rest Call" step which is changing the space to the "+" symbol if we keep it as is.

Anthony Holloway
Cisco Employee
Cisco Employee

Are you actually using the dollar sign ($) in front of your variable name?  I have never seen that before and a quick check shows that the $ is a reserved character.  I'd drop it if you're not sure, or if you are sure it needs to be there, then I think you need to percent encode it, which would mean replacing it with %24.

 

Also, spaces in a parameters as plus signs (+) are fine, you shouldn't worry about that part.  UCCX is just trying to encode your content, which should be fine. Look no further than how google and chrome work.

 

Screen Shot 2021-11-08 at 8.23.24 AM.png

 

If I were to try and send what you sent, I would do something like this in the URL spot of the Make REST Call step.

 

"https://ticketingsystem.com/search?filter=TicketNo eq '" + the_ticket_number + "'"

Where the variable the_ticket_number contains the actual ticket number I want to send to the ticketing system, and it's a String variable type, or I suppose it could be an int, because it would be cast to a String during the concatenation.

 

The end result should look like this, once UCCX replaces the variable value and encodes the URL (assuming my ticket number was 12345):

https://ticketingsystem.com/search?filter=TicketNo+eq+'12345' 

 

Hello Anthony,

Yes we need to append $ at the beginning of the parameter name.

We already tried what you suggested and we're getting a status of 200 OK, however, the web service response is the status of all the tickets in the database and not the specific ticket we passed as a parameter, noting that the same URI in postman returns the correct result.

I have attached screenshots for the "Make REST Call" step, the WS URI and the WS status.

Any help is highly appreciated.

 

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: