Skip to main content

Manage Avoids and Favors

Contents

Route Modifiers is a general term for roads to avoid or favor in routing. Route Modifiers are created in the ContentTools web tool, where they are organized into sets. Each set has a name and a setId. The avoid/favor endpoints below allow you to manage your fleet’s Route Modifier sets.

GET /avoidFavorSets

Retrieves all sets of Route Modifiers (avoids and favors) in the account.

Request

Authorization: bearer {token}

NameDescriptionData TypeRequired
offsetPagination parameter indicating the cursor position to begin with in the response for this request.
Int
N
limitPagination parameter indicating the number of results to return in the response for this request.
Int
N

Response

Results are returned in alphabetical order by Route Modifier set name.

NameDescriptionData Type
sizeThe number of Route Modifier sets returned.
Int
unfilteredSizeThe total number of Route Modifier sets in the fleet account.
Int
setIdUnique, system-generated identifier for the Route Modifier set.
Int
nameRoute Modifier set name in the fleet account.
String
VehicleGroupsThe Vehicle Groups to which the Route Modifier set is assigned. Each group has a vehicleGroupId (Int) and vehicleGroupName (String).
Object
isDefaultWhether or not the Route Modifier set is a default set for the fleet account.
Boolean

Sample Request

curl -X 'GET' \
  'https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets?Offset=0' \
  -H 'accept: application/json' \
  -H 'Authorization: bearer {token}'

Sample Response

{
  "href": "https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets",
  "offset": 0,
  "limit": 20,
  "size": 3,
  "unfilteredSize": 3,
  "first": {
    "href": "https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets?offset=0&limit=20"
  },
  "data": [
    {
      "setId": 10268636,
      "name": "Dave's Avoids",
      "vehicleGroups": [
        {
          "vehicleGroupId": 1272566,
          "vehicleGroupName": "All Trucks"
        }
      ],
      "isDefault": false
    },
    {
      "setId": 10231480,
      "name": "Kelly's Avoids",
      "vehicleGroups": [
        {
          "vehicleGroupId": 1282420,
          "vehicleGroupName": "AR Trucks"
        }
      ],
      "isDefault": false
    },
    {
      "setId": 10270653,
      "name": "TX Avoids",
      "vehicleGroups": [],
      "isDefault": false
    }
  ]
}

GET /avoidFavorSets/{setId}

Retrieves a single set of Route Modifiers (avoids and favors) in the account by its setId.

Request

Authorization: bearer {token}

NameDescriptionData TypeRequired
setIdUnique, system-generated identifier for the Route Modifier set.
Int
Y

Response

NameDescriptionData Type
setIdUnique, system-generated identifier for the Route Modifier set.
Int
nameRoute Modifier set name in the fleet account.
String
VehicleGroupsThe Vehicle Groups to which the Route Modifier set is assigned. Each group has a vehicleGroupId (Int) and vehicleGroupName (String).
Object
isDefaultWhether or not the Route Modifier set is a default set for the fleet account.
Boolean

Sample Request

curl -X 'GET' \
  'https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets/10231480' \
  -H 'accept: application/json' \
  -H 'Authorization: bearer {token}'

Sample Response

{
  "setId": 10231480,
  "name": "Kelly's Avoids",
  "vehicleGroups": [
    {
      "vehicleGroupId": 1282420,
      "vehicleGroupName": "AR Trucks"
    }
  ],
  "isDefault": false
}

GET /avoidFavorSets/vehicles/{vehicleId}

Retrieves all sets of Route Modifiers (avoids and favors) associated with a specific vehicleId.

Request

Authorization: bearer {token}

NameDescriptionData TypeRequired
vehicleIdVehicle Id that was added into the fleet account.
String
Y

Response

Results are returned in alphabetical order by Route Modifier set name.

NameDescriptionData Type
setIdUnique, system-generated identifier for the Route Modifier set.
Int
nameRoute Modifier set name in the fleet account.
String
isDefaultWhether or not the Route Modifier set is a default set for the fleet account.
Boolean

Sample Request

curl -X 'GET' \
  'https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets/vehicles/kellydemotruck' \
  -H 'accept: application/json' \
  -H 'Authorization: bearer {token}'

Sample Response

{
  "message": "Successfully retrieved avoid favor sets for the vehicle: kellydemotruck",
  "data": [
    {
      "setId": 10268636,
      "name": "Dave's Avoids",
      "isDefault": false
    }
  ]
}

GET /avoidFavorSets/vehicles/vehicleGroups

Retrieves all sets of Route Modifiers (avoids and favors) associated with specific Vehicle Groups.

Request

Authorization: bearer {token}

NameDescriptionData TypeRequired
vehicleGroupIdsThe Ids of the Vehicle Groups for which you want to retrieve Route Modifier sets.array of
Int
Y

Response

Results are returned in alphabetical order by Route Modifier set name.

NameDescriptionData Type
setIdUnique, system-generated identifier for the Route Modifier set.
Int
nameRoute Modifier set name in the fleet account.
String
isDefaultWhether or not the Route Modifier set is a default set for the fleet account.
Boolean

Sample Request

curl -X 'GET' \
  'https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets/vehicleGroups?vehicleGroupIds=1272566&vehicleGroupIds=1282420' \
  -H 'accept: application/json' \
  -H 'Authorization: bearer {token}'

Sample Response

{
  "message": "Successfully retrieved avoid favor sets for vehicle group(s): 1272566, 1282420",
  "data": [
    {
      "setId": 10231480,
      "name": "Kelly's Avoids",
      "isDefault": false
    },
    {
      "setId": 10268636,
      "name": "Dave's Avoids",
      "isDefault": false
    }
  ]
}

PUT /avoidFavorSets/{setID}/default/isDefault

Sets or removes a Route Modifier set (avoids and favors) as a default in the account.

Request

Authorization: bearer {token}

NameDescriptionData TypeRequired
setIdUnique, system-generated identifier for the Route Modifier set.
Int
Y
isDefaultWhether or not to assign the Route Modifier set as a default set for the fleet account.
Boolean
Y

Response

NameDescriptionData Type
messageWhether or not the default value was updated.
String
dataTrue if the Route Modifier set is now a default set for the account.
Boolean

Sample Request

curl -X 'PUT' \
  'https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets/10231480/default/true' \
  -H 'accept: application/json' \
  -H 'Authorization: bearer {token}'

Sample Response

{
  "message": "Successfully updated the avoid favor set default value",
  "data": true
}

POST /avoidFavorSets/{setID}/vehicleGroups/assign

Assign Vehicle Groups to a Route Modifier set (avoids and favors) in the account.

Request

Authorization: bearer {token}

Path Parameter

NameDescriptionData TypeRequired
setIdUnique, system-generated identifier for the Route Modifier set.
Int
Y

Request Body

NameDescriptionData TypeRequired
vehicleGroupIdsThe Ids of the Vehicle Groups you want to assign to the Route Modifier set.array of
Int
Y

Response

NameDescriptionData Type
messageWhether or not Vehicle Groups were assigned to a Route Modifier set.
String
dataTrue if a Vehicle Group was assigned to a Route Modifier set.
Boolean

Sample Request

curl -X 'POST' \
  'https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets/10231480/vehicleGroups/assign' \
  -H 'accept: application/json' \
  -H 'Authorization: bearer {token}
  -H 'Content-Type: application/json-patch+json' \
  -d '{
  "vehicleGroupIds": [
    1282420,1272566
  ]
}'

Sample Response

{
  "message": "The following vehicle groups are already assigned to the avoid favor set 10231480: 1282420. Successfully assigned the following vehicle groups: 1272566",
  "data": true
}

POST /avoidFavorSets/{setID}/vehicleGroups/unassign

Unassigns Vehicle Groups from a Route Modifier set (avoids and favors) in the account.

Request

Authorization: bearer {token}

Path Parameter

NameDescriptionData TypeRequired
setIdUnique, system-generated identifier for the Route Modifier set.
Int
Y

Request Body

NameDescriptionData TypeRequired
vehicleGroupIdsThe Ids of the Vehicle Groups you want to unassign from the Route Modifier set.array of
Int
Y

Response

NameDescriptionData Type
messageWhether or not Vehicle Groups were unassigned from a Route Modifier set.
String
dataTrue if a Vehicle Group was unassigned from a Route Modifier set.
Boolean

Sample Request

curl -X 'POST' \
  'https://fleets.trimblemaps.com/api/assets/v1/avoidFavorSets/10231480/vehicleGroups/unassign' \
  -H 'accept: application/json' \
  -H 'Authorization: bearer {token}
  -H 'Content-Type: application/json-patch+json' \
  -d '{
  "vehicleGroupIds": [
    1282420,1272566
  ]
}'

Sample Response

{
  "message": "Successfully unassigned the following vehicle groups: 1282420,1272566",
  "data": true
}
Last updated July 6, 2023.