MileApp Api Reference

Welcome to Mile App API! You can use this API to access all our API endpoints. All request and response bodies, including errors, are encoded in JSON. Paket Mile API provides a suite of simple and flexible API endpoints to read, modify, add or delete data.

Introduction

Overview


Welcome to Mile App API! You can use this API to access all our API endpoints. All request and response bodies, including errors, are encoded in JSON. Paket Mile API provides a suite of simple and flexible API endpoints to read, modify, add or delete data.

MileApp APIs are plain JSON over HTTP and use the following HTTP verbs:

COMMAND PURPOSE
GET Fetch one or more objects
POST Create an object
PUT Upsert an object
PATCH Update an object
DELETE Delete an object

Rate Limit


This limit is applied on an organization wide basis irrespective of factors such as the number of agents or IP addresses used to make the calls.

Limit Hit Time
100 1second

Authentication


All requests need an Bearer Token for authentication. Generate your API Key here:

  1. Visit https://web.mile.app
  2. Enter your user email address and password
  3. Sign in
  4. Go to Profile -> Personal Token
  5. Click on Generate





Status Code


Description: Response from POST data will return json data which contain status with HTTP status code = 200.

Success has the status code 200.

Error has the status code 4xx and contains error message in the body. Refer to the table below to understand what each code means.

No Error Code Text Description
1 401 Unauthorized For example, all API requires the API key to be sent and if it is missing, the status code is returned
2 400 Bad Request For example, the `Create Task` requires `flow` type to be sent and if it is missing, the status code is returned
3 404 Not Found This status code is returned when the request contains invalid ID or URL itself. For example, the `Read Task by ID` API requires taskid to be sent and if it is incorrect ID, the status code is returned
4 405 Method not Allowed This API request used the wrong HTTP method. For example, API `Get Task by ID` used GET method, when you sent PUT method, the status code is returned, as this API allows only GET method
5 406 Unsupported Accept Header Only application/json and */* are supported
6 409 Conflict Indicates a request conflict with current state of the target resource
7 413 Payload Too Large Indicates that the request entity is larger than limits defined by server
8 429 Too Many Requests Indicates the user has sent too many requests in a given amount of time
9 500 Unexpected Server Error This indicate error at Mile’s side
10 503 Service Unavailable The server is not ready to handle the request
11 504 Gateway Timeout Indicates that the server did not get a response in time that it needed in order to complete the request

Most errors will also return a message contains more information to help you debug.

For example, `Create Task` requires `flow` and if it is missing, the status code 400 will returned and some message will show:

"status": false,
"message": "The flow field is required."

Field Description
Status It is either `true` or `false`. If you are encountered an error, the status `false` is returned
Message Detailed error message