List all the vehicles and their locations (v3)

This API is only meant for vehicles with the Motive Vehicle Gateway. For others, you may use the V1 or V2 API.

Purpose: Use this API to fetch a list of all the company vehicles, and their information such as assigned drivers, their location, fuel type, and etc. The response will list out all the vehicles of your company with the corresponding details.

📘

NOTE

Use the query parameters only if you want to fetch the details of a particular vehicle and its corresponding info. Otherwise, ignore the parameters to fetch all the vehicle information of the company.

To use the API with the query parameters, add the following to the endpoint: "?vehicle_id={vehicle_id}&vehicle_status={vehicle_status}". Your endpoint with the query parameters will look like this: https://api.gomotive.com/v1/vehicle_locations?vehicle_id={vehicle_id}&vehicle_status={vehicle_status}

require 'uri'
require 'net/http'

url = URI('https://api.gomotive.com/v3/vehicle_locations')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"

response = http.request(request)
puts response.read_body

Response Parameters

vehicles

  • Type: Array of Objects
  • Description: A list of vehicle objects, each containing detailed information about an individual vehicle.

vehicle

  • Type: Object
  • Description: Contains detailed information about a specific vehicle including identifiers, specs, and telemetry.

id

  • Type: Number
  • Description: The unique identifier assigned to the vehicle.

number

  • Type: String
  • Description: The name or number assigned to the vehicle.

year

  • Type: String
  • Description: The model year of the vehicle.

make

  • Type: String
  • Description: The manufacturer or brand of the vehicle.

model

  • Type: String
  • Description: The model name of the vehicle.

vin

  • Type: String
  • Description: The Vehicle Identification Number, a unique code used to identify the vehicle.

aux_status

  • Type: Object
  • Description: Contains the statuses of auxiliary equipment installed in the vehicle.

AUX1 / AUX2

  • Type: Object
  • Description: Information about a specific auxiliary input.

present

  • Type: Boolean
  • Description: Indicates if the auxiliary equipment is installed and present.

start_time

  • Type: String (DateTime)
  • Description: The timestamp when the auxiliary input was engaged.

end_time

  • Type: String (DateTime)
  • Description: The timestamp when the auxiliary input was disengaged.

is_engaged

  • Type: Boolean
  • Description: Indicates whether the auxiliary input is currently engaged.

aux_equipment_type

  • Type: String
  • Description: Describes the type of auxiliary equipment, e.g., PTO, Generators.

current_location

  • Type: Object
  • Description: Contains real-time or last known location data of the vehicle.

lat

  • Type: Number
  • Description: Latitude coordinate of the vehicle's location.

lon

  • Type: Number
  • Description: Longitude coordinate of the vehicle's location.

bearing

  • Type: Number or null
  • Description: The compass direction the vehicle is facing.

located_at

  • Type: String (DateTime)
  • Description: The timestamp of the most recent known location.

city

  • Type: String
  • Description: City in which the vehicle is located.

state

  • Type: String
  • Description: State in which the vehicle is located.

rg_km

  • Type: Number
  • Description: Distance from a geofence or region in kilometers.

rg_brg

  • Type: Number
  • Description: Bearing from a geofence or region in degrees.

rg_match

  • Type: Boolean
  • Description: Indicates whether the vehicle matched a geofence region.

kph

  • Type: Number
  • Description: Current speed of the vehicle in kilometers per hour.

vehicle_state

  • Type: String
  • Description: Indicates whether the vehicle is on or off.

current_location

  • Type: String
  • Description: Human-readable location address of the vehicle.

Query Params
vehicle_ids[]
array of int32s

Enter the id of the vehicle for which you want to check the location. NOTE: The endpoint has a limit of 100 vehicles for fetching their locations.

vehicle_ids[]
string

Enter the status of the vehicle whose location you want to check. The status can be "active", or "deactivated".

int32
Defaults to 25

Number of records to return per page.

int32
Defaults to 1

Denotes the current page number.

boolean
Defaults to false

Specify if you want to include the auxiliary status in the response.

Headers
string

Time zone used to format timestamps.

boolean

System of units to use to convert different metrics. true for metric units and false for imperial units.

int32

ID of the Fleet Admin accessing the API.

Response

Language
Credentials
Header
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json