Skip to main content
GET
/
vehicles
Read vehicle
curl --request GET \
  --url https://apiweb.mile.app/api/v3/vehicles \
  --header 'Authorization: Bearer <token>'
{
  "current_page": 1,
  "data": [
    {
      "name": "Mini Van 34",
      "assignee": "leandro@mile.app",
      "speed": 30,
      "fixedCost": 15,
      "tags": [
        "Ganjil",
        "Depok",
        "B1124CC"
      ],
      "workingTime": {
        "startTime": "08:00",
        "endTime": "17:00",
        "multiday": 0
      },
      "capacity": {
        "width": {
          "min": 10,
          "max": 1000
        },
        "height": {
          "min": 10,
          "max": 1000
        }
      },
      "organizationId": "621dd813eb3ebf16b94dbde3",
      "hubId": "621dd813eb3ebf16b94d6969",
      "updatedTime": "2022-07-13T03:16:40+00:00",
      "createdTime": "2022-07-13T03:16:40+00:00",
      "_id": "62ce3918d3f3e1681a3a54b2"
    }
  ],
  "first_page_url": "http://apiweb.mile.app/api/v3/vehicles?q=truck%201&page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "http://apiweb.mile.app/api/v3/vehicles?q=truck%201&page=1",
  "links": [
    {
      "url": null,
      "label": "&laquo; Previous",
      "active": false
    },
    {
      "url": "http://apiweb.mile.app/api/v3/vehicles?q=truck%201&page=1",
      "label": "1",
      "active": true
    },
    {
      "url": null,
      "label": "Next &raquo;",
      "active": false
    }
  ],
  "next_page_url": null,
  "path": "http://apiweb.mile.app/api/v3/vehicles",
  "per_page": 10,
  "prev_page_url": null,
  "to": 1,
  "total": 1
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Query Parameters

hubId
string

Fundamental entity within an organization, serving as the central point for managing various operational components. Use Use GET /hubs endpoint to get the list of Hub IDs. Example: 634e98498ce07d29474a7e29

name
string

This field will search vehicles according to similar value of vehicle name. Example: B 1234 TEST

tags
string

This field will search vehicles according to similar value of vehicle tags. Example: jakarta

assignee
string

This field will search vehicles according to similar value of vehicle assignee. Example: jhon@mile.app

page
integer
default:1

The page number of results to retrieve. Example: 2

limit
integer
default:20

Specifies the maximum number of items to retrieve in a single request. Example: 10

Required range: 1 <= x <= 1000
sortBy
string

sortBy is used to sort the result-set in ascending or descending order according to selected field. The value of this param is one of available fields on vehicle objects. Example: name, assignee, speed, hubId, etc. Default: createdTime

sortOrder
string

sortOrder is to decide ascending or descending order Example: asc or desc. Default: desc

Response

Success

current_page
integer

The current page of data.

data
object[]

List of object vehicles.

first_page_url
string

Url to open the first page of data.

from
integer

Data order start from at current page.

last_page
integer

The number of last page.

last_page_url
string

Url to open the last page of data.

path
string

The base path without query string.

per_page
integer

The number of showing data per page.

to
integer

Data order last at current page.

total
integer

Total of vehicles data.