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
}
Property | Description |
---|---|
isEmpty | Indicating if the response has data in the value or it is void |
value | Value of the response(if any), a record that is provided |
message | String message explaining the result |
isSuccess | True if the action succeeded |
isFailure | True if the action failed |
httpStatusCode | Code 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.
Updated 7 months ago
What’s Next