get https://api.gomotive.com/v1/available_time
Purpose: Use this API to fetch a list of all the drivers with available time. Getting to know your driver's available time allows you to perform better scheduling and planning their routes more efficiently. Also, you can control labour costs my optimising the driver schedules, thereby improving customer service.
require 'uri'
require 'net/http'
url = URI('https://api.gomotive.com/v1/available_time')
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
user
- Type: Object
- Description: Details about the user, including duty status, available time, and HOS (Hours of Service) information.
duty_status
- Type: String
- Description: Current duty status of the user (e.g., "on_duty").
id
- Type: Integer
- Description: Unique identifier for the user.
first_name
- Type: String
- Description: First name of the user.
last_name
- Type: String
- Description: Last name of the user.
username
- Type: String
- Description: Username of the user.
email
- Type: String
- Description: Email address of the user.
driver_company_id
- Type: String or Null
- Description: ID of the driver's company.
status
- Type: String
- Description: Status of the user (e.g., "active").
role
- Type: String
- Description: Role of the user (e.g., "driver").
available_time
- Type: Object
- Description: Time availability breakdown for the user.
cycle
- Type: Integer
- Description: Total cycle time available in seconds.
shift
- Type: Integer
- Description: Total shift time available in seconds.
drive
- Type: Integer
- Description: Total drive time available in seconds.
break
- Type: Integer
- Description: Total break time available in seconds.
recap
- Type: Object
- Description: Summary of duty and driving durations.
on_duty_duration
- Type: Array of Objects
- Description: List of on-duty durations by date.
date
- Type: String (Date)
- Description: Date of the recorded duration.
duration
- Type: Integer
- Description: Duration of on-duty time in seconds.
driving_duration
- Type: Array of Objects
- Description: List of driving durations by date.
date
- Type: String (Date)
- Description: Date of the recorded duration.
duration
- Type: Integer
- Description: Duration of driving time in seconds.
seconds_available
- Type: Integer
- Description: Total available time in seconds.
seconds_tomorrow
- Type: Integer
- Description: Available time for the following day in seconds.
last_hos_status
- Type: Object
- Description: Most recent HOS status.
status
- Type: String
- Description: Current HOS status of the user (e.g., "on_duty").
time
- Type: String
- Description: Timestamp of the last HOS status update.
last_cycle_reset
- Type: Object
- Description: Information about the last cycle reset.
type
- Type: String
- Description: Type of cycle reset (e.g., "34_hour").
start_time
- Type: String
- Description: Start time of the last cycle reset.
end_time
- Type: String
- Description: End time of the last cycle reset.