Issue Passing "%" as a String Value via REST

Looking to pass terms code as an API parameter. It works fine if it is just letters and numbers (e.g. N30), but when the terms code has the % (e.g. 2%30, which passes encoded as 2%2530).

Here is an example if you’d like to see what I’m doing.

//// this is hypothetical for demo purposes, my code runs correctly without special characters
var auth = [YourAPIAuthentication];
var url = "https://[yourepicorurl]/Ice.BO.UD20Svc/UD20s";
var parameters = "(Company,Key1,Key2,Key3,Key4,Key5)";
//// In my case one of the Key's is equal to 2%30 or 2%2530
fetch( url + parameters, {
    headers: {
        'accept': 'application/json',
        'Authorization': auth
    method: 'PATCH',
    body: {
        CheckBox01: true,
        RowMod: 'U'

I get the following response.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

<html xmlns="">


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>

<title>404 - File or directory not found.</title>

<style type="text/css">


body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}

fieldset{padding:0 15px 10px 15px;} 



h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 

#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;


#content{margin:0 0 0 2%;position:relative;}






<div id="header"><h1>Server Error</h1></div>

<div id="content">

 <div class="content-container"><fieldset>

  <h2>404 - File or directory not found.</h2>

  <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>





Has anyone encountered this issue before? Any solution or suggestion is welcomed.

Yes, you always want to HTML Encode your data. More info here:

HTML Encoder / Decoder (

1 Like

The correct URL Encode for % is %25. Epicor’s RESP API Helper automatically encodes it correctly, but I get the error either way.

If you dump the resource (url + parameters) from your code, can you paste it into Postman and test it?

Another useful tool is postman-echo, which lets you post to a service and it echo’s the information from your API call.

Postman Echo | Postman API Network

So hypothetically, if the below was my ( url + parameters )


what should it look like?

You’re getting a 404, so it’s worth checking what you’re sending from different clients to see why the URL doesn’t see the resource you’re looking for. Making sure the URL is what you think it is may shed some light here.

Well here is the thing, if I send N30 instead of 2%30 (there are records for both), the request with N30 works perfectly, but the request with 2%30 returns the 404.
Does this make sense, or do I need to explain it better?

I completely understand what you’re saying.

However, you’re getting a 404, which means the URL is getting mangled somehow. If you dump it and see how it is getting mangled, then you may get some direction toward a resolution.

Gotcha, I’ll play with it in Postman see what happens.

1 Like

I can’t get it to work, so I’m just going to change my customization around.
Thanks for your help @Mark_Wonsil

1 Like