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

200OKThe request was successful.
201CreatedThe request succeeded in creating a new resource due to the POST or PUT request.
204No ContentThis is a response to a successful request that will not return a body (e.g., a DELETE request).
400Bad RequestThe server will not process the request due to a client error (e.g., bad request syntax, invalid message framing, or incorrect request routing).
401UnauthorizedThe request will not be processed unless the client authenticates the right way.
402Payment RequiredYour current license does not include this functionality
403ForbiddenThe client does not have access rights to the content (unauthorized). Unlike 401 Unauthorized, the server knows the client's identity.
404Not FoundThe server cannot find the requested resource.
405Method Not AllowedThe server knows the request method but is not supported by the target resource (e.g., DELETE).
415Unsupported Media TypeThe server does not support the media format of the requested data.
422Unprocessable ContentThe 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).
500Internal Server ErrorThe server has encountered a situation it does not know how to handle.
501Not ImplementedThe requested functionality is not implemented
504Gateway TimeoutWhen a server acts as a gateway and cannot get a response in time.