Fetch a vehicle's location using its ID (v2)

Purpose: Use this API to fetch the location of a particular vehicle using its ID. You must also specify the date for which you want to check the information of the vehicle as a query parameter.

šŸ“˜

NOTE

This is the v2 of the "Fetch the location of a vehicle using its ID" endpoint. For this API, you must specify the following Query Parameters:

  • start_date: Provide the start date from which you want to check the location history of the vehicle.
  • end_date: Provide the end date for when you want to check the location history of the vehicle.

IMPORTANT: The duration between the start date and the end date must not exceed 3 months.

  • updated_after: Provide the date after which the location records have been updated.
require 'uri'
require 'net/http'
require 'json'

url = URI("https://api.gomotive.com/v2/vehicle_locations/<id>?start_date=<yyyy-mm-dd>&end_date=<yyyy-mm-dd>")

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

šŸ“˜

NOTE

This endpoint has a limit of 10 simultaneous requests at a time.

Response Parameters

id

  • Type: String
  • Description: The unique identifier for the vehicle location.

located_at

  • Type: String (ISO 8601 Date-Time)
  • Description: The timestamp when the vehicle was located.

lat

  • Type: Number
  • Description: The latitude coordinate of the vehicle's location.

lon

  • Type: Number
  • Description: The longitude coordinate of the vehicle's location.

bearing

  • Type: Number
  • Description: The direction the vehicle is heading in degrees.

battery_voltage

  • Type: Number
  • Description: The voltage of the vehicle's battery at the time of location.

engine_hours

  • Type: Number
  • Description: The total engine hours at the time of location.

type

  • Type: String
  • Description: The type of location data (e.g., "breadcrumb").

description

  • Type: String
  • Description: A textual description of the vehicle's location.

speed

  • Type: Number
  • Description: The speed of the vehicle at the time of location in miles per hour (mph).

odometer

  • Type: Number
  • Description: The odometer reading of the vehicle in miles at the time of location.

fuel

  • Type: Number
  • Description: Denotes the lifetime fuel consumption of the vehicle.

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.

id

  • Type: Number
  • Description: The unique identifier for 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 associated with the driver.

email

  • Type: String
  • Description: The email address of the driver.

driver_company_id

  • Type: String
  • Description: The company identifier associated with the driver.

status

  • Type: String
  • Description: The status of the driver (e.g., "active").

role

  • Type: String
  • Description: The role of the driver (e.g., "driver").

id

  • Type: Number
  • Description: The unique identifier for the vehicle gateway.

identifier

  • Type: String
  • Description: The identifier of the vehicle gateway.

model

  • Type: String
  • Description: The model of the vehicle gateway.

Path Params
string
required

Specify the unique identifier of the vehicle.

Query Params
date
required

Specify the start date from which you want to fetch the vehicle's location history.

date
required

Provide the end date for when you want to check the location history of the vehicle.

date
required

Provide the date after which the location records have been updated.

Headers
string

Specify the timezone for formatting the timestamps.

boolean

Specify if you want to use the Metric units or the Imperial units. TRUE: Metric units. FALSE: Imperial Units

int32

Specify the ID of the Fleet Admin or the Fleet Manager who is accessing this endpoint.

Responses

Language
Credentials
Header
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json