get https://api.gomotive.com/v1/freight_visibility/vehicle_locations
Purpose: Use this API to fetch the location of all the subscribed vehicles. This endpoint will provide important details of the vehicle such as the driver info, the latitude and longitude coordinates of the vehicle, initial stop, final stop. and current location.
require 'uri'
require 'net/http'
url = URI('https://api.gomotive.com/v1/freight_visibility/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
Data
- Type: Object
- Description: Contains vehicle details and pagination information.
vehicle_details
- Type: Array of Objects
- Description: List of details for each vehicle.
start_time
- Type: String (DateTime)
- Description: The start time of the vehicle details.
end_time
- Type: String (DateTime)
- Description: The end time of the vehicle details.
load_id
- Type: String
- Description: The ID of the load associated with the vehicle, if applicable.
load_details
- Type: String
- Description: Additional information about the load.
total_distance
- Type: Object
- Description: The total distance traveled by the vehicle.
unit
- Type: String
- Description: The unit of distance (e.g., mi, km).
value
- Type: Integer
- Description: The numeric value of the total distance.
initial_stop
- Type: Object
- Description: The initial stop location coordinates.
lat
- Type: Float
- Description: Latitude of the initial stop.
lon
- Type: Float
- Description: Longitude of the initial stop.
final_stop
- Type: Object
- Description: The final stop location coordinates.
lat
- Type: Float
- Description: Latitude of the final stop.
lon
- Type: Float
- Description: Longitude of the final stop.
vehicle_location
- Type: Object
- Description: Details about the vehicle's current location.
lat
- Type: Float
- Description: Latitude of the vehicle's location.
lon
- Type: Float
- Description: Longitude of the vehicle's location.
located_at
- Type: String (DateTime)
- Description: Time when the vehicle was located.
description
- Type: String
- Description: A textual description of the vehicle's location.
current_driver
- Type: Object
- Description: Information about the current driver.
id
- Type: Integer
- Description: The ID of the driver.
first_name
- Type: String
- Description: The first name of the driver.
last_name
- Type: String
- Description: The last name of the driver.
email
- Type: String
- Description: The email of the driver.
status
- Type: String
- Description: The status of the driver.
role
- Type: String
- Description: The role of the driver.
vehicle_id
- Type: String
- Description: The unique identifier of the vehicle.
vehicle_name
- Type: String
- Description: The name of the vehicle.
company_id
- Type: String
- Description: The company associated with the vehicle.
dot_ids
- Type: Array
- Description: List of DOT IDs associated with the vehicle.
trailer_id
- Type: String
- Description: The trailer ID attached to the vehicle.
tracking_subscription_id
- Type: Integer
- Description: The tracking subscription ID.