Response Codes
Last updated
Last updated
This section contains the response codes you will likely get from the MytripAPI. The “code” parameter would usually contain the following response.
In a case where you encounter other status codes that are not listed here, do well to check HERE for possible meaning.
Response Code
Meaning
Note
200 (OK)
The request succeeded.
401 (Unauthorized)
Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
403 (Forbidden)
The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server.
404 (Not Found)
The server can not find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web.
408 (Request Timeout)
This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.
422 (Unprocessable Entity) (WebDAV)
The request was well-formed but was unable to be followed due to semantic errors. For example, in a case where a parameter receives an alphabet value instead of number.
500 (Internal Server Error)
The server has encountered a situation it does not know how to handle.
501 (Not Implemented)
The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.
502 (Bad Gateway)
This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.
503 (Service Unavailable)
The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This response should be used for temporary conditions and the Retry-After HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.
504 (Gateway Timeout)
This error response is given when the server is acting as a gateway and cannot get a response in time.