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
oroff
.
current_location
- Type: String
- Description: Human-readable location address of the vehicle.