get https://api.gomotive.com/v2/vehicle_locations
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/v2/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
- Description: A list of vehicle objects, each containing detailed information about a specific vehicle.
id
- Type: Number
- Description: The unique identifier assigned to the vehicle.
number
- Type: String
- Description: The fleet number assigned to the vehicle.
year
- Type: String
- Description: The year the vehicle was manufactured.
make
- Type: String
- Description: The manufacturer of the vehicle.
model
- Type: String
- Description: The model of the vehicle.
vin
- Type: String
- Description: The Vehicle Identification Number (VIN) of the vehicle.
fuel_type
- Type: String
- Description: The type of fuel the vehicle uses (e.g., "diesel").
current_location
- Type: Object
- Description: The current location of the vehicle, including coordinates, description, and other related data.
id
- Type: String
- Description: The unique identifier of the location.
lat
- Type: Number
- Description: The latitude of the vehicle's current location.
lon
- Type: Number
- Description: The longitude of the vehicle's current location.
description
- Type: String
- Description: A textual description of the vehicle's current location.
located_at
- Type: String (ISO 8601 date format)
- Description: The timestamp when the location data was recorded.
bearing
- Type: Number
- Description: The bearing direction of the vehicle in degrees.
battery_voltage
- Type: Number
- Description: The current battery voltage of the vehicle.
type
- Type: String
- Description: The type of movement or status of the vehicle (e.g., "vehicle_moving").
speed
- Type: Number
- Description: The speed of the vehicle in miles per hour.
engine_hours
- Type: Number
- Description: The total engine hours of the vehicle.
fuel
- Type: Number
- Description: The current amount of fuel in the vehicle's tank.
fuel_primary_remaining_percentage
- Type: Number
- Description: The percentage of fuel remaining in the primary fuel tank.
fuel_secondary_remaining_percentage
- Type: Number
- Description: The percentage of fuel remaining in the secondary fuel tank.
odometer
- Type: Number
- Description: The vehicle's odometer reading in miles.
true_odometer
- Type: Number
- Description: The actual odometer reading, which may be adjusted for accuracy.
true_engine_hours
- Type: Number
- Description: The actual engine hours, adjusted for accuracy.
veh_range
- Type: Number
- Description: The estimated remaining range of the vehicle in miles.
hvb_state_of_charge
- Type: Number
- Description: The state of charge of the vehicle's high-voltage battery.
hvb_charge_status
- Type: Enum
- Description: The current charging status of the vehicle's high-voltage battery. The values are as follows:
- 0 => NOT_AVAILABLE,
- 1 => NOT_CHARGING,
- 2 => CHARGING,
- 3 => ERROR,
hvb_charge_source
- Type: Enum
- Description: The source of the vehicle's high-voltage battery charge. The values are as follows:
- 0 => NOT_AVAILABLE,
- 1 => AC,
- 2 => DC,
hvb_lifetime_energy_output
- Type: Number
- Description: The lifetime energy output of the vehicle's high-voltage battery.
current_driver
- Type: Object
- Description: Information about the current driver of the vehicle, including identification and status.
id
- Type: Number
- Description: The unique identifier assigned to the driver.
first_name
- Type: String
- Description: The first name of the driver.
last_name
- Type: String
- Description: The last name of the driver.
username
- Type: String
- Description: The username of the driver.
email
- Type: String
- Description: The email address of the driver.
driver_company_id
- Type: String
- Description: The unique identifier of the driver's company.
status
- Type: String
- Description: The status of the driver (e.g., "deactivated").
role
- Type: String
- Description: The role of the driver (e.g., "driver").
per_page
- Type: Number
- Description: The number of vehicles returned per page.
page_no
- Type: Number
- Description: The current page number of the returned results.
total
- Type: Number
- Description: The total number of vehicles available in the response.