REST message request payload

teroruuskanen
Giga Contributor

Greetings,

I'm doing outbound REST messages to AirWatch and need to set request payload to the messages. Where do I set this in the outbound REST message settings?

Also if I'm creating the REST messages in script, how do I set the request payload in the script? Example:

var sm = new sn_ws.RESTMessageV2();

sm.setEndpoint("https://url.com");

sm.setHttpMethod("post");

sm.setHttpTimeout(6000);

sm.setMIDServer("mid server name");

sm.setRequestHeader("Accept", "application/json");

sm.setRequestHeader("Authorization","***");

sm.setRequestHeader("aw-tenant-code","****");

var response = sm.execute();

Thank you.

2 REPLIES 2

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Tero,



Please check if the below helps!



How can api payload as {data:{ ?!



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


This answers the script part but how do I set the payload in the outbound rest message that's not scripted?