Status Codes
When you call any REST resource, the response header returns one of the standard HTTP status codes listed in the following table. These status codes refer to a three-digit number in the response header that indicates the general classification of the response. For example, the codes indicate whether the request was successful (200s), or resulted in a client (400s) or server (500s) error. The 400 and 500 classes of status codes help in troubleshooting bad requests.
HTTP Status Code | Description |
---|---|
200
OK
|
Success! A successful GET or POST method returns a 200 status code.
|
201
Created
|
Your request is successful and a new resource has been created. Response includes a Location header containing the canonical URI for the newly created resource. You receive a 201 status code from:
|
202
Accepted
|
The server has accepted your request for
processing, but has not yet completed processing it. Your request might be accepted
or rejected during processing.
This code is useful in asynchronous resource creation or updates. It indicates that the server has accepted your request, so you don't need to wait or be connected until the process completes. The server delivers a response that contains a Location header of a Status Resource for the Transmission associated with the request. Your client should poll this resource to determine the transmission's completion state and status. |
400
Bad Request |
Your request couldn't be processed because it contains missing or invalid information, such as a validation error on an input field, a missing required value, and so forth. |
401
Unauthorized |
Your request isn't authorized. The authentication credentials included with this request are missing or invalid. |
403
Forbidden
|
You don't have authorization to perform this request. |
404
Not Found
|
Your request includes a resource URI that doesn't exist. |
405
Method Not Allowed |
HTTP action specified in the request (DELETE , GET , POST , PUT ) isn't supported for this request URI.
|
406
Not Acceptable |
Although the server understands and processes your request, your client can't understand the server response because it's unsupported. A client's request header indicates what data or media types are acceptable. For example, the client's Accept header requests that XML be returned, but the server can return only JSON. |
409
Conflict |
The syntax of the client message is correct but the server rejects the message to the current state of the resource in the database. For example, an attempt is made to create a resource using an ID that already exists. |
415
Not Acceptable |
Indicates that the server refuses to accept the client request because the payload format is unsupported. In your client, the ContentType header isn't correct. For example, the client attempts to send the request in XML, but the server can accept only JSON. |
500
Internal Server Error |
The server encountered something unexpected that prevented it from completing the request. |
503
Service Unavailable |
Indicates that the server is unable to complete the request due to a server overload. This condition is usually temporary. |
Note:
All 4xx and 5xx status codes will also contain a message body containing an Error Resource message with more information on the cause of the error.