Almost every response contains the redundant ownCloud/NextCloud meta envelope, which is a redundancy on top of the HTTP error code. The HTTP error code already told us that the request was wrong, there is no reason to return this information.
What makes sense is to provide useful information for the end user in the response, something like this:
HTTP/2.0 400 Bad Request
{
"code": 3,
"message": "invalid token",
"documentation": "url pointing to the endpoint definition"
}
As far as I've seen in the last years, this is what modern APIs return.
There are some cases the 'statusCode' is 997, and that error code is not documented at all and is coming from ownCloud/NextCloud implementation.
Idem for successful responses, the data envelope could be avoided as this API isn't HATEOAS oriented.
Almost every response contains the redundant ownCloud/NextCloud meta envelope, which is a redundancy on top of the HTTP error code. The HTTP error code already told us that the request was wrong, there is no reason to return this information.
What makes sense is to provide useful information for the end user in the response, something like this:
As far as I've seen in the last years, this is what modern APIs return. There are some cases the 'statusCode' is 997, and that error code is not documented at all and is coming from ownCloud/NextCloud implementation. Idem for successful responses, the data envelope could be avoided as this API isn't HATEOAS oriented.