We’ve been working on this article. Please let us know how useful this new version is by voting.
OutSystems allows you to customize the information sent in responses when exposing a REST API.
For that, do the following:
In the Logic tab, open the Integrations folder.
In the exposed REST API, set the property On Response to
Open the "OnResponse" callback action that's now available under the REST API.
Design the logic to customize the information of the response.
You can get the text of the response by accessing the "ResponseText" attribute of the "Response" input parameter or its binary contents by accessing the "ResponseBinary" attribute.
Make sure to set the "CustomizedResponse" output to the request after your preprocessing.
Once defined and configured in the REST API, OutSystems executes the "OnResponse" callback for all methods exposed by the REST API.