I am trying to rest API request body as "fieldname" : "RS${env}Test" but the ${env} part is getting ignored while sending. If I try to use html encoding, destination not able to decode it. What is the possible way to send the request body?

Utsab
Tera Contributor

I want to pass below job names as an Input request of PUT method of REST message which is in JSON format having “${env}” in the name of Jobs. It is observed after sending the request, “${env}” gets ignored and third party application database gets updated as RHDEM_****
Correct Job name : RH${env}DEM_****
Changed job name : RHDEM_****

1 ACCEPTED SOLUTION

UtsabGiri
Mega Expert

Got a reply from HI Team, this function is OOTB and can't be avoided. We can only replace the special characters by HTML encoding and it has to be decoded at client end.

View solution in original post

6 REPLIES 6

Utsab
Tera Contributor

var PUTinput = {"name":"RH${env}DEM_XXXX","emailNotifications":[],"setVariableActions":[]}

 

NOTE = Request Body contains about 300 fields. For sample I have put 3. Below is PUT function called from the script include.

 

resData = this.jobDefinition3(PUTinput ));

 

jobDefinition3: function(getResponse) {
var r = new sn_ws.RESTMessageV2('XXXX.Release_Integration', 'PUT');
r.setRequestBody(getResponse);
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
return responseBody;
},

UtsabGiri
Mega Expert

Got a reply from HI Team, this function is OOTB and can't be avoided. We can only replace the special characters by HTML encoding and it has to be decoded at client end.