4.3 Response Messages
4.3.1 Indicating Success
OHI HTTP API services make use of HTTP status codes in the HTTP headers to indicate a success. The following table lists these status codes:
Code |
Meaning |
Description |
---|---|---|
200 |
OK |
Request succeeded for GET calls. May also be used for DELETE calls that complete synchronously |
201 |
Created |
Request succeeded for creation of a resource |
202 |
Accepted |
Request accepted for asynchronous POST or DELETE calls |
204 |
No Content |
Request succeeded for updating or deleting a resource |
In the case of successfully creating a resource next to a 201 status code, the server returns the Location URI. In the HTTP specification, it is optional whether the server sends the representation of the newly created resource. In many cases, it will send a full response body as it may contain further processing instructions for the client in the form of hypermedia links.
In the case of successfully updating a resource, according to the HTTP specification the server has to respond in one of the following ways:
- Header "HTTP 200 OK", accompanied by a full response body or
- Header "HTTP 204 No Content", without any response body.
By default, OHI systems will send "HTTP 200 OK" and a full response body. After updating a resource the server does not return a Location URI.
In the case of successfully deleting a resource, according to the HTTP specification the server has to respond in one of the following ways:
- Header "HTTP 200 OK" if the response includes an entity describing the status; OHI systems use this option if a sub-entity was deleted to return the modified (master) entity.
- Header "HTTP 202 Accepted" if the action has not yet been enacted; OHI systems use this option if the entity is deleted at a later stage.
- Header "HTTP 204 No Content" if the action has been enacted but the response does not include an entity; OHI systems use this option if the entity was deleted successfully
Requests that GET one or more resources will have a response structure specific to the integration point.