How to pass special characters in Rest API Query parameter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-30-2022 01:00 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-30-2022 01:13 AM - edited ā11-30-2022 01:14 AM
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-30-2022 01:20 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-30-2022 01:32 AM
HI @Vineela1
I think we need more infomation about the error message ...