get https://api.gomotive.com/v1/hours_of_service
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 anend_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.