get https://api.gomotive.com/v1/freight_visibility/vehicle_locations/details
Purpose: Use this API to fetch the recent location details of a specific vehicle. It is important to note that you can only view the location history of the past 24 hours or less. The following are the things to remember when using this endpoint:
THINGS TO REMEMBER
- The
start_time
and theend_time
, must be within the past 24 hours or less. This endpoint will not fetch the historical location data.- You must have an active tracking subscription for the vehicle.
- The vehicle must not be deactivated.
- The
start_time
and theend_time
must match or be within thestart_time
and theend_time
of the vehicle subscription.
require 'uri'
require 'net/http'
url = URI('https://api.gomotive.com/v1/freight_visibility/vehicle_locations/details')
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 information about vehicle locations.
vehicle_locations
- Type: Array of Objects
- Description: List of vehicle locations with details such as coordinates, speed, and engine hours.
d
- Type: String
- Description: Unique identifier for the vehicle location event.
located_at
- Type: String
- Description: Timestamp of when the vehicle location was recorded.
lat
- Type: Float
- Description: Latitude of the vehicle’s location.
lon
- Type: Float
- Description: Longitude of the vehicle’s location.
description
- Type: String
- Description: Descriptive location of the vehicle (e.g., city, state).
bearing
- Type: Integer
- Description: The vehicle's directional bearing in degrees.
engine_hours
- Type: Float
- Description: Number of engine hours recorded.
type
- Type: String
- Description: Type of vehicle event (e.g., vehicle moving).
speed
- Type: Float
- Description: Speed of the vehicle in miles per hour.
fuel
- Type: Float
- Description: The amount of fuel remaining in gallons.
odometer
- Type: Float
- Description: The vehicle’s odometer reading in miles.