CentraSite Documentation : Working with REST-based APIs : About CentraSite RESTful API Model : Supported HTTP Status Codes
Supported HTTP Status Codes
An API response returns a HTTP status code that indicates success or failure of the requested operation.
CentraSite allows you specify HTTP codes for each method to help clients understand the response. While responses can contain an error code in XML or other format, clients can quickly and more easily understand an HTTP response status code. The HTTP specification defines several status codes that are typically understood by clients.
CentraSite includes a set of predefined response codes that are classified in the following categories:
Predefined Response Code Categories
Description
1xx
Informational.
2xx
Success.
3xx
Redirection. Need further action.
4xx
Client error. Correct the request data and retry.
5xx
Server error.
For information on the status codes that CentraSite supports out-of-the-box, in CentraSite Control, go to Administration > Taxonomies. On the Taxonomies page, enable the Show all Taxonomies option. Navigate to HTTP Status Codes in the list of taxonomies.
HTTP/1.1 defines all the legal status codes. Examine these codes to determine which are appropriate for your API.
Consider the case of online Phone Store API. The following table describes the HTTP status codes that each of the URIs and HTTP methods combinations will respond:
Resource URI
Supported HTTP Methods
Supported HTTP Status Codes
/phones/orders
GET
200 (OK, Success)
/phones/orders
POST
201 (Created) if the Order resource is successfully created, in addition to a Location header that contains the link to the newly created Order resource; 406 (Not Acceptable) if the format of the incoming data for the new resource is not valid
/phones/orders/{order-id}
GET
200 (OK); 404 (Not Found) if Order Resource not found
/phones/orders/{order-id}
DELETE
204 (OK); 404 (Not Found) if Order Resource not found
/phones/orders/{order-id}/status
GET
200 (OK); 404 (Not Found) if Order Resource not found
/phones/orders/{order-id}/paymentdetails
GET
200 (OK); 404 (Not Found) if Order Resource not found
/phones/orders/{order-id}/paymentdetails
PUT
201 (Created); 406 (Not Acceptable) if there is a problem with the format of the incoming data on the new payment details; 404 (Not Found) if Order Resource not found
/phones/orders/{order-id}/paymentdetails
PATCH
200 (ok); 404 (Not Found) if Order Resource not found
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback