Add assets to an existing group

Purpose: Use this API to add an asset to an existing group. You must specify the IDs of the assets that you are adding as body parameters. Refer to the Path and Body parameters for more info.

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

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

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 asset or assets 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!