add_payload_error

Overview

There may be errors that occur at different stages during the run of a Clear API. When the API author wishes to notify the user of an error in the system, they can use the add_payload_error to notify the user. These manifest in the ClearWork UI as red error message pop-ups. These errors will also be present in the payload that is returned in the API.

Parameters

  • messagestring – The message to display

Example

{% add_payload_error "User is not authorized to approve this purchase order." %}