post https://api.gomotive.com/v1/freight_visibility/subscribe
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:
- If you are subscribing the location of vehicle, follow these requirements:
- Vehicle must be owned by a company.
- Vehicle status must be 'active', and not 'deactivated'.
- This endpoint does not allow overlapping of tracking instances.
- If you are subscribing the location of an asset, follow these requirements:
- Asset status must be 'active', and not 'deactivated'.
- Every asset must have an asset gateway assigned to it.
- The query parameter
start_time
, must be less than 2 weeks from the current date.- The minimum difference between the
start_time
andend_time
must be 1 hour.- The maximum difference between the
start_time
and theend_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.