How to pass special characters in Rest API Query parameter.

Vineela1
Tera Contributor

Hi  All,

We have requirement to pass the special characters through Rest API query parameter. We need to fetch the data from external third party vendor using Outbound - Rest message via Scheduled job we are calling the rest message and passing parameters.

Now we have a requirement to pass this string . "CONVERT%28DATE,modifiedDateTime%29=%272022-06-06T00:00:00.000Z%27".

 

We used this lines.

 

var filter1="CONVERT%28DATE,modifiedDateTime%29=%272022-06-07T00:00:00.000Z%27";

r.setStringParameterNoEscape('filter',filter1);

But getting error message as "ERROR - DB - REACH TIMEOUT OR ISSUES".

 

Please suggest how to pass this string with special characters as it is.

 

Regards,

 

Vineela

3 REPLIES 3

newhand
Mega Sage

HI @Vineela1 

It seems that the fiter1 is used as a search condition in a sql.

Can you show the error log about the rest api?

 

I'm not sure if  it works or not  , please try the bellow code.

 

var filter1="CONVERT(DATE,modifiedDateTime)='2022-06-07T00:00:00.000Z'";
r.setStringParameterNoEscape('filter',filter1);

 

 

Please mark my answer as correct and helpful based on Impact.

Vineela1
Tera Contributor

Hi,

Yes, it is like a SQL query. Our client requested to send the parameter in this format. 

var filter1="CONVERT%28DATE,modifiedDateTime%29=%272022-06-07T00:00:00.000Z%27";

 

I have tried with this format also. getting same error message.

 

var filter1="CONVERT(DATE,modifiedDateTime)='2022-06-07T00:00:00.000Z'";
r.setStringParameterNoEscape('filter',filter1);

Error message is "ERROR - DB - REACH TIMEOUT OR ISSUES".

 

Regards,

Vineela

HI @Vineela1 

I think  we need more infomation about the error message ...

 

 

 

Please mark my answer as correct and helpful based on Impact.