Provide errors in API responses
I found that when trying to create a supplier (company) using the API, I was getting a 400 response code but no detail on why. Through support, I learned that it was because I was using an invalid timezone code.
It is crucial for development of systems which consume an API to have rich, helpful error messages when the developer is at fault (e.g. not providing enough information or providing invalid information).
A JSON (or XML) response like this would be really useful:
{ "status": 400, "message": "Bad request", "errors": [ "Invalid timezone" ] }
-
Hi Gareth,
Of course I do agree with this. For the API v1 we log errors internally only.
However, with the API v2 we provide such error details in the response. API v2 does not yet have the method you are using but it will in the upcoming months.
https://documents.wordbee.com/display/API2/System+API+v2
Regards,
Stephan
0
Please sign in to leave a comment.
Comments
1 comment