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
vehicle
- Type: Object
- Description: Contains detailed information about a specific vehicle.
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 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.
current_location
- Type: Object
- Description: The current location of the vehicle, including geographic coordinates, city, state, and additional location data.
lat
- Type: Number
- Description: The latitude of the vehicle's current location.
lon
- Type: Number
- Description: The longitude of the vehicle's current location.
bearing
- Type: Null
- Description: The bearing of the vehicle's movement, if available. Currently, it is not set.
located_at
- Type: String (ISO 8601 date format)
- Description: The timestamp when the location data was recorded.
city
- Type: String
- Description: The city where the vehicle is currently located.
state
- Type: String
- Description: The state where the vehicle is currently located.
rg_km
- Type: Number
- Description: The range in kilometers for a particular geofence or location.
rg_brg
- Type: Number
- Description: The bearing in degrees related to the range geofence or location.
rg_match
- Type: Boolean
- Description: Indicates whether the vehicle matches the range geofence criteria (
true
orfalse
).
kph
- Type: Number
- Description: The speed of the vehicle in kilometers per hour.
vehicle_state
- Type: String
- Description: The current operational state of the vehicle (e.g., "off").
current_location
- Type: String
- Description: The textual description of the vehicle's current location, including address details.