response.status or response.statusmessage
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 09:32 PM
Hello Exports,
we have created rest message for add the users on ADM group, our script is working fine for success.
but if users not added also we are getting the success.
how do i define
if condition for respone. (response status" 0 " or response status message. for failure ).
below
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
if (httpStatus == '200') {
workflow.scratchpad.responsestatus = 'success';
workflow.scratchpad.response = ' Access granted';
}
else {
workflow.scratchpad.responsestatus = 'failed';
workflow.scratchpad.response = 'Failed to add. Below is the response. \n'+JSON.stringify(responseBody);
0 REPLIES 0