rest api variable substitution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 06:31 PM
We are facing some challenges in complex variable substitution in outbound rest API web service.
Endpoint: https://<ip_address>/rest/server-hardware?filter=${filter}
Method: GET
Variable substitution: "name EQ 'SGH817YECA, bay 12' "
yours helps/inputs are greatly appreciated.
Regards
Soibam

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2019 09:38 PM
may i know your instance version details also have you checked the mid server status? is that validate ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 07:15 PM
The mid server is validated and up. its developer instance with Jakarta version

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 07:32 PM
are you doing it on PDI then i can give a try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 07:57 PM
Yes , its personal developer instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2019 11:57 PM
Hi soibam.ana.singh,
It appears that your Endpoint contains spaces, quotes, comma which might be a cause for concern
My suggestion is that instead of passing that as a single variable you break-up your Endpoint(handle all the single-quotes,comma delimiters in the endpoint definition as shown below) and use multiple variables
Your Endpoint should look like this
Note the space between ${1} and ${2} also the single-quote before ${3} and then a comma followed by ${4} ending with single-quote
Here's what your variable substitutions should look like
Since you are handing all the single-quotes, spaces etc before passing the variable the "No escaping" option should work fine
The REST Message script should look something like this
var r = new sn_ws.RESTMessageV2('<name>', 'Default GET'); r.setStringParameterNoEscape('3', 'SGH817YECA'); r.setStringParameterNoEscape('4', 'bay 12'); r.setStringParameterNoEscape('1', 'name'); r.setStringParameterNoEscape('2', 'EQ');
Try this out, hopefully it should resolve the error