New Assign Template or Group

/v2/routes/assignTemplateOrGroup

Assigns a route to a vehicle, using a designated route template or route group

Parameters

data

The parameter of this endpoint is it's payload, and is decribed bellow

{
  "vehicleId": 0,
  "assignType": "once",
  "templateOrGroupId": 0,
  "weekDays": [
    "sunday"
  ],
  "timestamp": "2024-09-12T15:49:29.361Z",
  "duration": 0,
  "routeName": "string",
  "sendTo": true,
  "departStepID": 0,
  "arriveStepID": 0,
  "freeField1": "string",
  "freeField2": "string",
  "freeField3": "string"
}

FieldDescription
vehicleId The vehicle to which a new route should be assigned. int yes
assignType Defines the type of assignment:

Assign typeDescription
1OnceThis option assumes that the ID provided in the field templateOrGroupId belongs to a route template.
A single route execution will be created and assigned to the specified vehicle.
2Week Frotcom will create one assignment for each week day specified.
The routes executions are for the vehicle are created weekly as they are necessary.
3RouteGroupThis option assumes that the ID provided in the field templateOrGroupId belongs to a group of routes.
One route execution for each route in the group will be created and assigned to the specified vehicle.

int/enum 10 no
templateOrGroupId The ID of the template or group of routes. int yes
weekDays The set of days on which the route get's assigned to the vehicle:

Day of the week
1sunday
2monday
3tuesday
4wednesday
5thrusday
6friday
7saturday

int/enum If the field assignType is assigned to week
timestamp The timestamp of the Plan Departure of the first step of the route. yes
duration A number of seconds that will be added to the specified timestamp in order to determine the timestamp for the plan departure of the route execution int no 0
routeName * This field is not being used.
The name of the assigned route is always the name of the route template being used. string no
sendTo The terminal to which the route should be send to.
Possible options are:

Terminal type
0None
1DriverApp
2WFM
3NAV

bool no 0 (None)
departStepID The ID of the step in the route to consider as the departure step int no
arriveStepID The ID of the step in the route to consider as the arrival step int no
freeField1 Field of free aditional text string no
freeField2 Field of free aditional text string no
freeField2 Field of free aditional text string no

Response Body

[ <Assignments IDs> ]

The response is an array of the IDs of the assignments that were created by the endpoint.

Response HTTP Codes

200 - OK

  • The route was assigned to the vehicle with success

400 - BadRequest

  • The parameter was not provided, or
  • A validation error occurred

401 - Unauthorized

  • The provided credentials are not valid

403 - Forbidden

  • The user has no permission to view routes

404 - Not found

  • The specified vehicle could not be found, or
  • The specified route template could not be found