We are planning to develop an API. There are so many cases that a request can be considered as a bad request.
For this, We have planned to send a JSON object with error code
, error
,
and additional info
I have put the sample case here when a user sends an illumination image. We considered as this request is bad request and send the following JSON
{
"ErrorCode": 10000,
"Error": "Detected uneven illumination image",
"Additional Info": "Prefer to change the image location"
}
Can someone please help us or provide some trustful resources?
Check Stripe API they also use error codes (code
) to explain different 4xx
errors