The ShootProof API uses a problem detail, as defined by RFC 7807 to describe API errors. This response lets your app know that a problem occurred and provides you with information to debug the problem and try to resolve it.
application/problem+json
We use a variety of HTTP status codes for error responses, each of which aims to be in keeping with the defined HTTP semantics for the code. Here are a few of the more common or noteworthy error status codes we may use:
400 Bad Request
409 Conflict
507 Insufficient Storage
507
to let you know. There are other conditions that can lead to this response code as well. Check the reason
property in the info
extension for details.Our usage of the problem detail is formally described and extended from the standard. In particular, we have introduced the info
extension, which we use to convey additional information about the nature of the error.
If the error response is a result of validation errors, it will most likely be a 400 Bad Request
response and contain this info.errors
property. Each property name in the errors
object is a property that failed validation. These properties contain objects with property names in the form of internal validation error message slugs paired with human-readable string values describing the validation failure. Each property may have multiple validation failure messages.
The error messages describing the failures are intended for developers and not users of your app. You should program your app to present your users with appropriate error messages.
{
"type": "https://developer.shootproof.com/errors#error-bad-request",
"title": "Bad Request",
"detail": "There was a problem with your request. Please see `info` for more information.",
"status": 400,
"info": {
"errors": {
"salesTaxTitle": {
"noValue": "Sales tax title must be provided."
}
}
}
}