Results

This page contains a short overview of handling results when using the Zenegy API.

Results

Zenegy supports only JSON(application/json) response content type.

Zenegy APIs use result objects to wrap the return information with extra information.

Result object

The purpose of this result object wrapper is to provide extra information to the returned data.
All new APIs use the result object, which all will use soon.

Below is an example of the result object provided by Zenegy API.

Result example:

{
  "isEmpty": false,
  "value": {},
  "message": "",
  "isSuccess": true,
  "isFailure": false,
  "httpStatusCode": 200,
  "isNotFound": false
}
PropertyDescription
isEmptyIndicating if the response has data in the value or it is void
valueValue of the response(if any), a record that is provided
messageString message explaining the result
isSuccessTrue if the action succeeded
isFailureTrue if the action failed
httpStatusCodeCode description of the action result. Example 200 success

Legacy

The legacy API endpoints result is not wrapped, and the response's value is placed in the body of the response.


What’s Next