Skip to main content

Create and Modify Driver Groups

Contents

Add Driver Groups

POST /drivergroups

Adds one or more driver groups into the fleet’s account. There is a limit of adding up to 50 driver groups per API call.

Driver Group names are required to be unique in an account and up to 2,000 driver groups can be created in the fleet’s account.

Request

Authorization: bearer {token}

POST Body

NameDescriptionData Type
driverGroupName
(Required)
The driver group name added to the account. Each name must be unique within the fleet’s account.
String

Response

NameDescriptionData Type
driverGroupIdUnique, system-generated identifier for unique driver group.
Int
driverGroupNameDriver group that was added into the fleet’s account.
String
modifiedOnIndicates the last time the driver group was modified.
DateTime

Sample Request

[
  {
    "driverGroupName": "CherryHillDrivers"
  },
  {
    "driverGroupName": "MerryHillDrivers"
  }
]

Sample Response

[
  {
    "driverGroupId": 1345522,
    "driverGroupName": "CherryHillDrivers",
    "modifiedOn": "2023-02-15T14:00:40.09"
  },
  {
    "driverGroupId": 1345562,
    "driverGroupName": "MerryHillDrivers",
    "modifiedOn": "2023-02-15T14:00:40.09"
  }
]

Error Codes

MessageDescription
The request finished without adding duplicate driver groups.This error is thrown when a driver group already exists within the account.

Update a Specific Driver Group

PUT /drivergroups/{driverGroupId}

Updates a driver group name based on its unique driver group identifier.

Request

Authorization: bearer {token}

Query Parameter

NameDescriptionData Type
driverGroupId
(Required)
Unique system generated identifier for driver group.
Int

Request Body

NameDescriptionData Type
driverGroupNameNew name for the driver group. Must be unique within the fleet’s account.
String

Response

NameDescriptionData Type
messageAcknowledgement of the success or failure of the operation.
String
dataTrue if operation was successful.
String

Sample Request

{
  "driverGroupName": "CherryHillDrivers-PA"
}

Sample Response

{
  "message": "Successfully updated driver group",
  "data": true
}

Error Codes

MessageDescription
The request finished without updating non-existent driver group ID.This error is thrown when the driver group ID does not exist within the account.

Get a List of All Driver Groups

GET /drivergroups

Gets a list of driver groups available in the account. By default, the first 20 driver groups in the account will be populated.

Request

Authorization: bearer {token}

Response

NameDescriptionData Type
driverGroupIdUnique, system-generated identifier for unique driver group.
Int
driverGroupNameDriver group name.
String
modifiedOnIndicates the last time the driver group was modified.
DateTime

Sample Request

https://fleets.trimblemaps.com/api/assets/v1/drivergroups

Sample Response

{
  "message": null,
  "data": [
    {
      "driverGroupId": 557473,
      "driverGroupName": "CherryHillDriversUpdated",
      "modifiedOn": "2020-05-27T20:38:05.383"
    },
    {
      "driverGroupId": 557435,
      "driverGroupName": "First-Group",
      "modifiedOn": "2020-05-27T17:36:29.22"
    },
    {
      "driverGroupId": 557474,
      "driverGroupName": "MerryHillDrivers",
      "modifiedOn": "2020-05-27T20:36:06.647"
    }
  ]
}

Get a Specific Driver Group

GET /DriverGroups/{driverGroupId}

Gets a driver group by its driver group ID.

Request

Authorization: bearer {token}

Query Parameter

NameDescriptionData Type
driverGroupId
(Required)
Unique system generated identifier for driver group.
Int

Response

NameDescriptionData Type
driverGroupIdUnique, system-generated identifier for unique driver group.
Int
driverGroupNameDriver group name.
String
modifiedOnIndicates the last time the driver group was modified.
DateTime

Sample Request

https://fleets.trimblemaps.com/api/assets/v1/drivergroups/557473

Sample Response

{
  "message": null,
  "data": {
    "driverGroupId": 557473,
    "driverGroupName": "CherryHillDriversUpdated",
    "modifiedOn": "2022-11-27T20:38:05.383"
  }
}

Delete a Specific Driver Group

DELETE /drivergroups/{driverGroupId}

Delete a driver group by its unique driver group ID.

Request

Authorization: bearer {token}

Query Parameter

NameDescriptionData Type
driverGroupID
(Required)
Unique, system-generated identifier for unique driver group.
Int

Response

NameDescriptionData Type
messageText indicating the result of deleting a driver group.
String

Sample Request

https://fleets.trimblemaps.com/api/assets/v1/drivergroups/557473

Sample Response

{
  "message": "Successfully deleted driver group",
  "data": true
}

Error Codes

MessageDescription
No driver group found with Id: {}The response indicates that the driver group id passed in the request to delete was not found in the account.

Get List of Driver Groups by Driver

GET /driverGroups/drivers/{driverId}

Gets a list of driver groups associated with a specific driver.

Request

Authorization: bearer {token}

Query Parameter

NameDescriptionData Type
driverId
(Required)
The driver identifier for which you want to retrieve a list of driver groups. A driverId must be unique within the fleet account & partner cloud.
String

Response

NameDescriptionData Type
driverGroupIdUnique, system-generated identifier for unique driver group.
Int
driverGroupName The driver group name.
String

Sample Request

https://fleets.trimblemaps.com/api/assets/v1/driverGroups/drivers/driv1

Sample Response

{
  "message": "Successfully retrieved driver groups for driver driv1",
  "data": [
    {
      "driverGroupId": 1085632,
      "driverGroupName": "CherryHillDrivers"
    },
    {
      "driverGroupId": 1085633,
      "driverGroupName": "MerryHillDrivers"
    }
  ]
}

Error Codes

MessageDescription
No driver groups are associated with driver {driverId}.This error is thrown when no driver groups are associated with the requested driverId.
Last updated February 15, 2023.