Skip to main content

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

ParameterTypeDescription
StatusStringIndicates the operation status. Possible values: wrsSuccess: Operation completed successfully or wrsFailed: An error occurred in the operation
ErrorCodeStringError code returned when the operation is not successful. If the field is empty, it means no error occurred
MessageStringDetailed error message
ActorStringIdentification of the method/function that performed the operation
ReturnQuestionObject/NullAdditional 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 Status field 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.