Standard response object
The standard return object aims to ensure consistency in the response structure of all API endpoints, providing greater clarity in the information and facilitating the integration and consumption of methods by external applications.
Object Structure
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
}
}
Parameter Description
| Parameter | Type | Description |
|---|---|---|
| Status | String | Indicates the operation status. Possible values: wrsSuccess: Operation completed successfully or wrsFailed: An error occurred in the operation |
| ErrorCode | String | Error code returned when the operation is not successful. If the field is empty, it means no error occurred |
| Message | String | Detailed error message |
| Actor | String | Identification of the method/function that performed the operation |
| ReturnQuestion | Object/Null | Additional information returned by the system, which may vary according to the context |
❗Important Notice about HTTP Response
⚠️ Our API always returns HTTP status 200, even in cases of business errors.
Errors must be handled in the response object, based on the returned content.
- Only internal server errors will be returned as 500 - Internal Server Error.
- The
Statusfield in the response body must be checked to identify possible failures or business errors.
Successful Return Example
{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
}
}
Error Return Example
{
"WebServiceReturn": {
"Status": "wrsFailed",
"ErrorCode": "WSR-004",
"Message": "The provided parameter \"GetCustomInfoParams.CustomInfoScriptName\" is invalid!",
"Actor": "GetCustomInfo/GetCustomInfoCore/ValidateAndLoadQueryCustomParams",
"ReturnQuestion": null
},
"CustomInfoResultList": null
}
Considerations
- Status: It is required to identify the operation result.
- ErrorCode and Message: Should be used for debugging and displaying messages to the user.
- Actor: Can be used for auditing or to identify the point in the API where the problem occurred.
- ReturnQuestion: It is optional and may contain additional information specific to the endpoint.