REST API INTERPOLATION ISSUE

Community Alums
Not applicable

Hi, 
I hope this message finds you well. I have recently become aware of an issue related to REST API interpolation in ServiceNow that may be affecting some members of our community. 

var responseObj = {};
var requestBody = {
    'name' : 'hello 1',
    'subject' : "hello 1 ${active}",
}
var makeRest = new sn_ws.RESTMessageV2();
makeRest.setHttpMethod('POST');
makeRest.setEndpoint('https://*****.service-now.com/api/now/table/sysevent_email_action');
makeRest.setRequestHeader("Accept", "application/json");
makeRest.setRequestHeader('Content-Type', 'application/json');
makeRest.setBasicAuth('user', 'pass');

if (requestBody != "NONE") {
 makeRest.setRequestBody(new JSON().encode(requestBody));
    // makeRest.setRequestBody(JSON.stringify(requestBody));
}

var response = makeRest.execute();
responseObj.responseBody = response.getBody();
responseObj.httpStatus = response.getStatusCode();
var i = JSON.parse(responseObj.responseBody)
var y = i.result;
gs.print(JSON.stringify(i.result))





When I'm using POST method, it is not post the complete data in serviceNow 

0 REPLIES 0