API Errors and Status Code Definitions
Definition of HTTP Status Code
upSWOT applies the industry recognized policies regarding HTTP Status codes stated in the RFC21616, that also defines the Status-Line syntax as shown below:
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
The following status code categories are outlined in the HTTP specification that can be used to convey the results of a client's request:
- 2xx: Success – Indicates that the client's request was accepted successfully.
- 3xx: Redirection – The client must take additional action to complete their request.
- 4xx: Client Error – This category of error status codes points the finger at clients.
- 5xx: Server Error – The server takes responsibility for these error status codes.
If the API call fails, the server returns an error message with the appropriate status code.
HTTP Response codes
CODE | EXPOSITION | DESCRIPTION |
---|---|---|
200 | OK | The request was successful. |
201 | Created | The request succeeded in creating a new resource due to the POST or PUT request. |
204 | No Content | This is a response to a successful request that will not return a body (e.g., a DELETE request). |
400 | Bad Request | The server will not process the request due to a client error (e.g., bad request syntax, invalid message framing, or incorrect request routing). |
401 | Unauthorized | The request will not be processed unless the client authenticates the right way. |
402 | Payment Required | Your current license does not include this functionality |
403 | Forbidden | The client does not have access rights to the content (unauthorized). Unlike 401 Unauthorized, the server knows the client's identity. |
404 | Not Found | The server cannot find the requested resource. |
405 | Method Not Allowed | The server knows the request method but is not supported by the target resource (e.g., DELETE). |
415 | Unsupported Media Type | The server does not support the media format of the requested data. |
422 | Unprocessable Content | The server is unable to process a request because it contains semantic errors or does not meet certain conditions (e.g., the input password matches one in a password log counter). |
500 | Internal Server Error | The server has encountered a situation it does not know how to handle. |
501 | Not Implemented | The requested functionality is not implemented |
504 | Gateway Timeout | When a server acts as a gateway and cannot get a response in time. |