The Response Manager is used to define the details of a response from the API back to the calling system.

Content Type
The Response Message Protocol can be set with the Content Type. The following formats can be used
- JSON
- XML
- plaintext
- ISO Message
HTTP Status
See Status Codes for a list of standard HTTP status codes.
It can also be a variable e.g ${varHttpStatus} or GLU reserved word for HTTP status code GLU_STATUS_CODE to pass the last status code from third party, example below.

ResponseCode and ResponseMessage
Within the GLU.Engine, the responseCode and responseMessage from an Outbound Connector are mapped within the Response Handler internally to SystemErrorCode and SystemErrorMessage. This is a default setting so even though the Code and Message my not in fact indicate an ‘Error’ scenario, these values will be mapped to to SystemErrorCode and SystemErrorMessage parameters. In the API (Response) drop-down lists for the ‘Response Code’ and ‘Response Message’ it is possible to pick the SystemErrorCode and SystemErrorMessage to map the values to your Response payload.
Pass Last Response Content Back
If this Checkbox is ticked the value in the template field will not be used. Instead the content of the last orchestrated connector will be passed back as the response to the API.
The Error Template, however can still be defined.
Save Response As
The ‘save response as’ checkbox allows you to store the response returned into a GLU object which can be used again within that transaction. This could be for the purposes of sending this payload as part of a DB call, or to send it back as a parameter. Both the outgoing response back from the 3rd party as well as the GLU engine response can be stored as an object. Once the parameter name is defined, it can be used as any other parameter in the integration. In the example below, responseBackToClient can be referred to with: ${responseBackToClient }

Template & Error Template
The structure of your API response is defined here.
Setting up response templates
You can setup the success template as is required as the response to the API.
The template supports ES6 format.
So, for example, if you wanted to pass a parameter you could add ${<Parameter Name>} to your template and it would be replaced with the parameter value at runtime.

For both the error and successful templates, parameters can be specified as the response parameters.
Triggering a success or failure response

The defined structure in ‘Template’, will be triggered for successful response messages.
The defined structure in ‘Error Template’ will be triggered when the API is deemed too have failed.
A successful response will be triggered when the value held within the ‘Response Code’ selected parameter in the dropdown is validated (and matches) the ‘Response Code To Validate’ value.

In the above example, when the response_code = 0, the success template will be triggered. If the response_code <> 0, the error template will be triggered.
When an error template is not defined, the GLU default error template will be used. See example below:
{
“error_message”: “Transaction Failed”,
“Message”: “There is No Response Template for FAILED Transactions”,
“GLU_TRX_ID”: “68dfa42b-cb4f-4b87-9c41-055b00789d57”,
“error_code”: “-99999”
}
Note: When using a STOP PROCESS handler in the configuration, an error response will be triggered [note, this excludes the STOP PROCESS successful response]. This will populate the responseCode and responseMessage (or as configured in the parameters manager control panel) with the specified error code and error message as detailed in the stop process. Should an error template not be defined, the default engine error template will be triggered and the GLU ‘systemErrorCode’ and systemErrorMessage’ will be updated with the values specified in the STOP PROCESS handler.
Including an array in the response template
To reference the array in your response payload, you can add an array like this: ${accounts[]} and the full array with the name will print.
It will display it in the response payload like this:
"accounts": [ { "accountID": 0, "amount": 17209, "balanceType": "Savings" }, { "accountID": 1, "amount": 0, "balanceType": "Money" }, { "accountID": 23, "amount": 0, "balanceType": "Money" }, { "accountID": 65, "amount": 0, "balanceType": "Money" }, { "accountID": 1018, "amount": 0, "balanceType": "Money" }, { "accountID": 1018, "amount": 0, "balanceType": "Money" } ]