How to call system property into rest message header.

dgarad
Giga Sage

We have a requirement to to call the system property (which contains API and APP Key) into Rest Message hearder.

How to achieve this? Thanks in advance

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad
1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@dgarad 

you can set the header dynamically

something like this

var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://dev22614.service-now.com/api/now/table/u_cart_order');
request.setHttpMethod('POST');

request.setRequestHeader('headerName', gs.getProperty('propertyName'));

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader