Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Cannot modify a property of a sealed object: sn_ws.

mufizs
Kilo Contributor

Hello,

 

I am trying to make an outbound rest call but seeing an error.

 

Cannot modify a property of a sealed object: sn_ws.

 

below is my code that is causing the error.

 
var request = new sn_ws.RESTMessageV2();
gs.info("2 created request")
request.setEndpoint(apiEndpoint);
request.setHttpMethod('POST');
request.setRequestHeader('Content-Type', 'application/json');
// request.setRequestHeader('Authorization', 'Bearer ' + apiKey);
request.setRequestBody(JSON.stringify(alertPayload));
 
please provide guidance on how to fix this.
 
 
 
0 REPLIES 0