...
Some API calls use more complex JSON or XML input formats. Some functionality of these calls are only accessible through a POST with one of these content types, rather than the form encodings.
Response Format
The HTTP 1.1 standard dictates that the responses consist of a status line, headers, and a response body. In addition, the NetMRI API has standardized response bodies for some of the specific status codes that may be returned.
Status Codes
The NetMRI API utilizes standard HTTP 1.1 status codes as defined in RFC2616, Section 6. One additional standard code, 102 Processing from RFC2518, is also used.
One non-standard code, 265 Deprecated, is used to indicate that the API call used is a deprecated call. This should be treated as a 200 OK with regard to processing but provides a warning that the call may go away in a future release.
The status codes below are commonly used by NetMRI. Other codes may be returned based on standard HTTP semantics.
Code | Reason Phrase | Description |
---|---|---|
102 | Processing | The code indicates that the server has received and is processing the request, but there is no response yet. |
200 | OK | The request succeeded. Standard HTTP 1.1 status code. |
201 | Created | The request to create an entity succeeded. Standard HTTP 1.1 status code. |
202 | Accepted | The request has been accepted for processing, but the processing has not been completed. Standard HTTP 1.1 status code. |
265 | Deprecated | The request succeeded and does not need to be repeated. However, the specified API call is deprecated and will be removed in a future version. |
301 | Moved Permanently | The requested resource is assigned a new permanent URI. Standard HTTP 1.1 status code. |
400 | Bad Request | Used for application-level error responses. For example, this will be used when a form submission fails to pass the form validations. |
403 | Forbidden | The server understood the request but is refusing to fulfill it. Standard HTTP 1.1 status code, but the NetMRI adds a payload to determine if this is due to access controls or lack of authentication (see below). |
404 | Not Found | The server has not found anything matching the Request-URI. Standard HTTP 1.1 status code. |
409 | Conflict | The server cannot process the request due to a conflict. This generally means that any attempt to create a new resource violates a uniqueness constraint. |
410 | Gone | The requested resource is no longer available at the server and no forwarding address is known. Standard HTTP 1.1 status code, used when a subsequent version obsoletes an API call. |
413 | Request Entity Too Large | The server is refusing to process a request because the request entity is larger than the server is willing or able to process. This is a standard HTTP 1.1 status code and is returned, for example, instead of a 102 if the request has exceeded internal NetMRI timeouts. |