How to set Query Parameters in an REST Message from a third party web service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 05:23 AM
For example, I have this web service: http://server/Test-service/Test('AAA')
In the Rest Message configuration, I need to set it up in such a way that when I call the web service, I can pass a value like 'AAA'.
I tried setting the endpoint as http://server/Test-service/Test('AAA') then tested it and it works correctly.
But I need to pass the value to web service not to hardcode it in the endpoint.
Thanks in advance.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 06:43 AM
Hi Alyssa
You need not to set Query parameters in end point
If you open your HTTP Method what ever that you are using.. You can see the option 'HTTP Query Parameters'. You can add your query parameters over there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2016 11:35 PM
Hi Kumar,
Thanks for your input. I have tried doing this but unfortunately it did not work for me. I tried using pankaj_puniani instead and it worked fine. Nevertheless, your input is very much appreciated!
Regards,
Alyssa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 01:41 PM
Hi Alyssa,
try setting endpoint something like this : http://server/Test-service/Test('${input}')
and while invoking this rest message in script, use RestMessagv2 setStringParameter API, something like:
var restMessage = new sn_ws.RESTMessageV2('<Rest message name>', '<Rest message function name>');
restMessage.setStringParameter('input','AAA');
Hope it helps,
Pankaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2016 11:36 PM
Hi Pankaj,
This method worked for me. Thank you so much!!
Regards,
Alyssa