List the drivers with location and vehicle info.

Purpose: Use this API to fetch a list of all the existing drivers of your company. This API will also fetch details such as existing location and the vehicle that the driver is using. This is helpful if you want an overview of all the drivers and their driven vehicles.

require 'uri'
require 'net/http'

url = URI('https://api.gomotive.com/v1/driver_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

user

  • Type: Object
  • Description: Contains the details of a user.

id

  • Type: Number
  • Description: The unique identifier for the user.

first_name

  • Type: String
  • Description: The first name of the user.

last_name

  • Type: String
  • Description: The last name of the user.

username

  • Type: String
  • Description: The username of the user.

email

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

driver_company_id

  • Type: Number
  • Description: The ID of the company associated with the driver.

status

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

role

  • Type: String
  • Description: The role of the user, such as "driver".

current_location

  • Type: Object
  • Description: Contains the current location details of the user.

id

  • Type: Number
  • Description: The unique identifier for the location.

lat

  • Type: Number
  • Description: The latitude of the user's current location.

lon

  • Type: Number
  • Description: The longitude of the user's current location.

description

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

located_at

  • Type: String
  • Description: The timestamp of when the location was recorded.

current_vehicle

  • Type: Object
  • Description: Contains the current vehicle details associated with the user.

id

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

pagination

  • Type: Object
  • Description: Contains pagination details for the response.

pagination.per_page

  • Type: Number
  • Description: The number of results per page.

pagination.page_no

  • Type: Number
  • Description: The current page number.

pagination.total

  • Type: Number
  • Description: The total number of results available.

Query Params
driver_ids[]
array of int32s

Specify the ids of the drivers for whom you want to fetch the location and vehicle info.

driver_ids[]
int32
Defaults to 25

Number of records to display per page.

int32
Defaults to 1

Denotes the current page number.

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.

Response

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