REST API INTERPOLATION ISSUE
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 01:26 AM - edited 08-01-2023 01:41 AM
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