Pipe character "|" in data action api url

Hello!
I'm trying to configure an API calls to an endpoint in GET:

domainname/php_api/api-clients.php?list_in_name=PHONE|COUNTRY&list_in_value=123456789|FR

the problem is when I try to test the call I got the message:

"Failed due to malformed requestUrlTemplate. Illegal character in query at index 73: https://domainname/php_api/api-clients.php?list_in_name=PHONE|COUNTRY&list_in_value=123456789|FR"

seems is the "|" the issue.
I have already tried with some of Velocity macros also the one below:

list_in_name=$salesforce.escReserved(${input.list_in_name})&list_in_value=$salesforce.escReserved(${input.list_in_value})

but I got the same issue.
any idea?
Thanks!
davide

I believe the issue is that you're not using the unicode for the "|" character like you would do for a space (%20). The unicode for the pipe symbol is | so try %124 and see if that fixes it.

Ciao Greg, using %7C it works...but how to replace dynamically "|" with "%7C" in the Action setup?

Hello,
I found the solution using the macro $esc.url():

api-clients.php?list_in_name=$esc.url(${input.list_in_name})&list_in_value=$esc.url(${input.list_in_value})

Thanks!
davide

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.