Status Codes
All API endpoints may return a Success, Redirect, or Error status code.
Success
All API endpoints may return the following codes indicating a successful request.
A JSON response body may be provided for 2xx
level codes. Always verify that the Content-Type
HTTP header is
application/json
before parsing a response as JSON.
Status | Name | Description |
---|---|---|
200 | OK | The request succeeded and content is returned. |
201 | Created | The request succeeded and a resource has been created. |
204 | No Content | The request succeeded and there is no content to return. |
Redirect
All API endpoints may return the following codes indicating a new endpoint is to be used for the request.
A redirect response will not include a response body. Use the URL provided in the HTTP Location
header to retry your
request.
Status | Name | Description |
---|---|---|
301 | Moved Permanently | This endpoint has changed permanently - please use the new URL given for all future requests. |
302 | Found | This endpoint has changed temporarily - please use the new URL given for this request. |
Error
All API endpoints may throw the following errors. It is your responsibility to handle these errors appropriately, including retrying requests when needed until they succeed.
A JSON response body may be provided for 4xx
level codes. A JSON or an HTML response body may be provided for 5xx
level codes. Always verify that the Content-Type
HTTP header is application/json
before parsing a response as JSON.
Status | Name | Description | Resolution |
---|---|---|---|
400 | Bad Request | The server could not understand the request. | Check all body and query parameters and ensure the request is valid. |
401 | Unauthorized | The request is unauthenticated. | Ensure your JWT is valid. |
403 | Forbidden | The client does not have access rights to this content. | Ensure your Partner ID, endpoint, and method are correct. |
404 | Not Found | The resource was not found. | Ensure your Partner ID, endpoint, and method are correct. |
405 | Not Allowed | The request method is not allowed. | Ensure your method is correct. |
409 | Conflict | The request conflicts with the current state of the server. | Ensure your Partner ID, endpoint, and method are correct. Some resources cannot be modified. |
429 | Too Many Requests | The users has sent too many requests in the given amount of time (rate limiting). | Wait and retry your request. |
500 | Internal Server Error | The server has encountered an unexpected error. | Wait and retry your request. Contact engineering@abswarranty.net if the issue persists. |
502 | Bad Gateway | The server was unable to communicate with another service. | Wait and retry your request. Contact engineering@abswarranty.net if the issue persists. |
503 | Service Unavailable | The server is not ready to handle the request. | Wait and retry your request. Contact engineering@abswarranty.net if the issue persists. |
504 | Gateway Timeout | The server was not able to complete your request in time. | Wait and retry your request. Contact engineering@abswarranty.net if the issue persists. |
Error Response Body
Some error responses may provide a JSON response body with additional error details. This response may include:
error
– the name of the errorstatusCode
– the corresponding HTTP status code of the errormessage
– additional information about the errorsentryId
– a unique ID corresponding to this error event
If the error body includes sentryId
please reach out to engineering@abswarranty.net
and provide us with this ID. This will help us trace the root cause of the issue and resolve it more efficiently.
Do not rely on the statusCode
provided in the response body when handling errors. A JSON response body may not be
provided. Instead, use the status code sent in the HTTP response header.
Example Error Responses
{
"error": "unauthorized",
"statusCode": 401,
"message": "Invalid partner token: \"iat\" must be greater than or equal to \"2024-09-18T13:00:21.024Z\""
}
{
"error": "internal server error",
"statusCode": 500,
"sentryId": "d2181cbb8da442adb34ef5e6bb0327ea"
}
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>