Response Actions
Response Actions are interceptors that allow you to customise the way responses are handled.
By default, a successful request is determined by the response HTTP Code being in the info (1xx) or success (2xx) ranges and anything outside of these is treated as a request failure.
Sometimes, an API will return a response that needs to be treated differently to how it would normally be handled. For example, an API might return a 400 error to indicate a part of the request contains invalid data. We can use a response action to catch that error and do something about it.
Execution Flow
The Response Action executes the following steps:
Run retry logic. Retry logic takes precedence and will cancel the Response Action if possible. If no more retries can be made (or no retry is required), the Response Action is executed.
If no retry error has occurred, the request and transaction states are updated according to the Response Action.
Notify the user by adding an integration note. A note will only be added according to the notification script on the Integration.
If a script is specified, execute the script.
Response Action Fields
Details
The Details fields that can be configured for the Response Action record are as follows:
Settings
The Settings fields that can be configured for the Response Action record are as follows:
^Retry
When selected, an additional Advanced retry
boolean type field becomes available (which if selected, also reveals another additional Retry script
field in which to configure any scripted method of retrying).
*Notify user
When selected, an additional Notify message
string type field becomes available in which to enter the required notification text.
**Transaction/Process/Request state
When ’–None–’ is selected, the state is left as is and not overridden.
***Run script
When selected, an additional Script
field becomes available in which to configure any scripted method of executing the Response Action.
Active
The Active field can be configured for the Response Action record as follows:
This flag is actually set via the Enable/Disable buttons that are available on the editable action.