Skip to main content

Overview

MileApp uses conventional HTTP response codes to indicate the success or failure of an API request.
  • Codes in the 2xx range indicate success
  • Codes in the 4xx range indicate an error that failed given the information provided
  • Codes in the 5xx range indicate an error with MileApp’s servers (these are rare)

HTTP Status Codes

CodeTextDescription
200SuccessIndicates that the request has succeeded.
201CreatedIndicates that the request has succeeded and has led to the creation of a resource.
400Bad RequestIndicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing).
401UnauthorizedIndicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource.
404Not FoundThis status code is returned when the request contains invalid ID or URL itself.
405Method not AllowedIndicates that the server knows the request method, but the target resource doesn’t support this method.
406Not AcceptableIndicates that the server cannot produce a response matching the list of acceptable values defined in the request’s proactive content negotiation headers. Only application/json and */* are supported.
409ConflictIndicates a request conflict with current state of the target resource.
413Payload Too LargeIndicates that the request entity is larger than limits defined by server.
429Too Many RequestsIndicates the user has sent too many requests in a given amount of time.
500Unexpected Server ErrorIndicates error at MileApp’s side (these are rare).
502Bad GatewayIndicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server (these are rare).
503Service UnavailableIndicates the server is not ready to handle the request (these are rare).
504Gateway TimeoutIndicates that the server did not get a response in time that it needed in order to complete the request (these are rare).

Error Response Format

When an error occurs, the API returns a JSON response with the following structure:
{
  "status": false,
  "message": "Error description here"
}