List company drivers with Hours of Service (HOS)

Purpose: Use this API to fetch a list of all the company drivers and their corresponding Hours of Service (HOS). This allows you to view all the drivers with their Hours of Service (HOS) details so that you can optimise planning, and scheduling of the drivers more efficiently and effectively.

📘

NOTE

Please provide either start_date or an end_date for the API call.

require 'uri'
require 'net/http'

url = URI('https://api.gomotive.com/v1/hours_of_service')

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
puts response.code

Response Parameters

hours_of_services

  • Type: Array of Objects
  • Description: List of hours of service records.

hours_of_service

  • Type: Object
  • Description: Details of the hours of service record.

id

  • Type: Integer
  • Description: Unique identifier for the hours of service record.

date

  • Type: String (Date)
  • Description: Date of the hours of service record.

off_duty_duration

  • Type: Integer
  • Description: Duration of off-duty time in seconds.

on_duty_duration

  • Type: Integer
  • Description: Duration of on-duty time in seconds.

sleeper_duration

  • Type: Integer
  • Description: Duration of sleeper time in seconds.

driving_duration

  • Type: Integer
  • Description: Duration of driving time in seconds.

waiting_duration

  • Type: Integer
  • Description: Duration of waiting time in seconds.

driver

  • Type: Object
  • Description: Details of the driver associated with the hours of service record.

id

  • Type: Integer
  • Description: Unique identifier for the driver.

first_name

  • Type: String
  • Description: First name of the driver.

last_name

  • Type: String
  • Description: Last name of the driver.

username

  • Type: String
  • Description: Username of the driver.

email

  • Type: String
  • Description: Email address of the driver.

driver_company_id

  • Type: String
  • Description: ID of the driver's company.

status

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

role

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

pagination

  • Type: Object
  • Description: Pagination details for the response.

per_page

  • Type: Integer
  • Description: Number of records per page.

page_no

  • Type: Integer
  • Description: Current page number.

total

  • Type: Integer
  • Description: Total number of records available.

Query Params
driver_ids[]
array of int32s

Specify 1 or more driver IDs for whom you want to fetch the hours of service.

driver_ids[]
date

Specify the start date from when you want to see the drivers HOS records. Default: TODAY.

date

Specify the end date till when you want to see the HOS records. Default: TODAY.

int32
Defaults to 25

Number of records per page.

int32
Defaults to 1

Denotes the 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.

Responses

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