freight_visibility/vehicle_association (v2)

Get locations of all vehicles of a company, with a matching score and ordered by their score to provided location of interest. Matching score is calculated based on three factors.

a. Vehicle Location against expected time. If the destination can be reached within the given expected time, a score of 0.5 is added to the final score.
b. HOS left for the vehicle. The HOS of the vehicle based on the drivers is computed. If the left HOS cycle time is within expected time, a score of 0.3 is added to the final score.
c. Direction of the vehicle. The direction of the moving vehicle is matched against the direction of the given destination lat & lon. If there is a match, a score of 0.2 is added to the final score.

The final matching score ranges from 0.0 to 1.0, where a score of 0.0 implies that none of the conditions matched, and a score of 1.0 implies that all conditions matched.

Fleets with large number of vehicles will see higher latency for the api.

require 'uri'
require 'net/http'

url = URI('')

http =, url.port)
http.use_ssl = true

request =
request['Authorization'] = "Bearer <OAUTH_TOKEN>"

response = http.request(request)
puts response.read_body
Click Try It! to start a request and see the response here!