Subscribe to the location of a vehicle or an asset

Purpose: Use this API to subscribe to the location of a vehicle or an asset. When you subscribe to the location of an asset or a vehicle, you are essentially tracking the location of that object. You must specify how long you want to subscribe to the location or in other words, how long you want to track the location. This is determined by the start_time and the end_time parameters.

👍

IMPORTANT

When you are using this endpoint, you must remember the following points:

  1. If you are subscribing the location of vehicle, follow these requirements:
    1. Vehicle must be owned by a company.
    2. Vehicle status must be 'active', and not 'deactivated'.
  2. This endpoint does not allow overlapping of tracking instances.
  3. If you are subscribing the location of an asset, follow these requirements:
    1. Asset status must be 'active', and not 'deactivated'.
    2. Every asset must have an asset gateway assigned to it.
  4. The query parameter start_time, must be less than 2 weeks from the current date.
  5. The minimum difference between the start_time and end_time must be 1 hour.
  6. The maximum difference between the start_time and the end_time must be 5 days.
require 'uri'
require 'net/http'

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

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"

response = http.request(request)
puts response.read_body

Response Parameters

tracking_subscription_id

  • Type: Integer
  • Description: Denotes the ID for tracking the location of the asset or the vehicle.

Language
Credentials
Header
Click Try It! to start a request and see the response here!