10-27-2021 11:10 PM
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.
10-28-2021 05:53 AM - edited 10-28-2021 05:58 AM
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.
11-02-2021 01:07 AM - edited 11-02-2021 01:08 AM
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.
11-02-2021 05:46 AM
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.
11-08-2021 04:42 AM
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.
11-08-2021 06:38 AM
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.
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'
11-09-2021 07:06 AM
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.
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