Create a new group

Purpose: Use this API to create a new group for your organisation. You must ensure to specify the name and the ID of the parent group while creating a new group. Refer to the Body Parameters section for more info.

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

url = URI('https://api.gomotive.com/v1/groups')

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 = {
  :name                => "East Coast",
}
request.body = params.to_json

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

Response Parameters

Group

  • Type: Object
  • Description: Details of a specific group.

id

  • Type: Integer
  • Description: The unique identifier for the group.

name

  • Type: String
  • Description: The name of the group.

company_id

  • Type: Integer
  • Description: The unique identifier for the company associated with the group.

user

  • Type: Object
  • Description: Details about the user associated with the group.

id

  • Type: Integer
  • Description: The unique identifier for the user.

first_name

  • Type: String
  • Description: The first name of the user.

last_name

  • Type: String
  • Description: The last name of the user.

username

  • Type: String or null
  • Description: The username of the user, if available.

email

  • Type: String
  • Description: The email address of the user.

driver_company_id

  • Type: Integer or null
  • Description: The unique identifier for the company associated with the driver, if available.

status

  • Type: String
  • Description: The status of the user.

role

  • Type: String
  • Description: The role of the user within the company.

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