Server Error Codes

From Hostway API Documentation
Jump to: navigation, search

Successful Responses



200 Ok
The requested action succeeded (completely) and the response body indicates further information.
201 Accepted
The request has been received but has not been completed and the response body should indicate a pointer to the objects monitor. Usually for creating objects asynchronously.
202 No Content
The request was accepted and completed. No further information is provided. For example, deleting a resource.
204 Created
The request was accepted and completed. The response should indicate a pointer to the objects monitor.


Redirection



304 Not Modified
This is returned on a GET request for objects that support caching and requires a request header for "If-Modified-Since".
303 See Other
Used in some cases during paging to redirect back to the beginning of the paginated result set. For example when requesting page 11 of only 10 pages.


Client Errors



400 Bad Request
Request is not valid because of an invalid URI or invalid or missing parameters.
401 Unauthorized (*)
Should be returned when the request is not properly authorized with the Authorization header. Is also used if the request attempts to access objects or accounts it does not own. Or if the given account subject of the request could not be found. Should be used in relation to the authentication header.
403 Forbidden
The request was authorized but does not have permission to perform the requested action. For example trying to edit an object owned by another account. Trying to use more resources than the client owns.
404 Not Found
The URI does not lead to a resource, or the requested object, or a related object could not be found.
405 Method Not Allowed
Attempting to call an HTTP method that is not allowed on the given object. For example trying to call POST or PUT on an object that was already created and cannot be modified.
406 Not Acceptable (*)
Used in one case in the DNS API if the request contains data that is not acceptable or valid. Should be returned as a HTTPBadRequest.
409 Conflict
The requested action could not be completed according to the current state of the object. For example attempting to modify a product that is still in pending status..
413 Request Entity Too Large
In rare cases where the request could not be fulfilled because the result would take too many resources. This error should **NOT** be returned for invalid request data that exceeds data length restrictions such as a telephone number with 100 digits. A valid reason for this error may be for example a bulk order that contains 5,000 products.
415 Unsupported Media Type
If the request header indicated a media type that is not supported. Also used when the given media is not in the correct format such as a JSON message body that has syntax errors and cannot be parsed.


Server Errors



For any API request the response may be a server error code of the group 5xx. Server errors are not caused by an error in the client request. In many cases retrying the request may solve the issue.

500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
501 Not Implemented
The server does not support the functionality required to fulfill the request.
502 Bad Gateway
The server received an invalid response from the upstream server it accessed in attempting to fulfill the request.
503 Service Unavailable
The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.
504 Gateway Timeout
The server did not receive a timely response from the upstream server or some other auxiliary server it needed to access in attempting to complete the request.

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox