restV2 rest end point response

webMethods 10.5
Licensed

Creating restV2 resource rest endpoint

Hi,

Does anybody know how to return a boolean response in the response body. I am using pub.flow:setResponse2 to set the response string:

I want to return something like below:

Positive response

{

"success": true,

}

Negative response

{

"success": false,

"error": "xyz"

}

Thanks

Hi @DT30 ,

Instead of just using the Restv2 resource and invoking the API using the /restv2 directive. Create a Rest API Descriptor and define the signature of the API output as per your requirement. You wouldn’t need to do any additional processing for it. And once you create the Rest API Descriptor, invoke your REST API using the /rad directive.

Thanks,
Sree

Should be something like this

true case
image

false case
image