workspace
workspace copied to clipboard
API Response codes and error handling
Hello, when an API request fails, currently the response is just a "500 Internal Server Error" with html body. This happens e.g. when I try to create a workspace with a group id that is already used by another workspace.
Alternatives:
- To align with Nextcloud core or apps, there should be a nested response structure like
{ocs: {meta: {statuscode: ***, message: "Id already occupied", status: "failure"}, data: {}}}. The actual http response code would be just 200. - Alternatively, to behave more like some other APIs, there could be a response code and message more specific than "500 Internal Server Error".
Hi @donquixote
Thank you for your feedbacks :+1:
About the OCS model, we are studying the structure of ours API/Rest and determine whether it is suitable for our case.
Alternatively, to behave more like some other APIs, there could be a response code and message more specific than "500 Internal Server Error".
I think we fixed this issue. I keep your issue under your hat if I will meet this error type.