post https://api.gomotive.com/v1/groups//users
Purpose: Use this API to add a new user or multiple users (drivers) to an existing group.
You must specify the ID of the group into which you are adding the users, and specify the ID of the drivers as Body Parameters. Refer to the Path Parameter and the Body Parameter section for more info.
require 'uri'
require 'net/http'
require 'json'
url = URI('https://api.gomotive.com/v1/groups/<id>/users')
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 => [14]
}
request.body = params.to_json
response = http.request(request)
puts response.read_body
Response Parameters
success
- Type: Boolean
- Description: Denotes if the user or users (drivers) were added successfully to the group. Mostly the value for this parameter will be "true". Otherwise, you will see the status 400 appearing.