CentraSite Documentation : Working with REST-based APIs : Getting Started with the CentraSite REST API Data 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 content types that are classified in the following taxonomy categories:
Predefined Taxonomy Category
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
Copyright © Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback