Modify the duration of a subscription

Purpose: Use this API to modify the duration of the start_time and the end_time for the tracking subscription that you've created earlier. You must specify the tracking subscription ID and mention the new start time and the end time. You must however, keep in mind the following rules:

👍

Modification Requirements

  1. The query parameter start_time, must be less than 2 weeks from the current date.
  2. The minimum difference between the start_time and end_time must be 1 hour.
  3. The maximum difference between the start_time and the end_time must be 5 days.
  4. New start_time must be earlier than the previous date.
  5. New end_time must be later than the previous date.
  6. This endpoint does not allow overlapping of tracking instances.
  7. 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'.
  8. 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.
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::Put.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"

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

Response Parameters

success

  • Type: Boolean
  • Description: Denotes if the modification to the subscription was successful or not. Mostly the value for this parameter will be "true". Otherwise, you will see the status 400 appearing.

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