Add a vehicle to a group

Purpose: Use this API to add a new vehicle to an existing group. You must specify the ID of the group, as well as the ID of the vehicle that you want to add to that group.

📘

NOTE

You may add multiple vehicles to a group. You must specify the ID of all the available vehicles as Body Parameters. Refer to the Body Parameters section for more info.

require 'uri'
require 'net/http'
require 'json'

url = URI('https://api.gomotive.com/v1/groups/<id>/vehicles')

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

request = Net::HTTP::Post.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
request['Content-Type'] = 'application/json'
params = {
  :ids                 => [4]
}
request.body = params.to_json

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

Response Parameters

success

  • Type: Boolean
  • Description: Denotes if the vehicle or vehicles were added successfully to the group. 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!