latestOpenAPI 3.1.02026-07-1295183803.5 KB

b647f1808dda

Dispatches_Routes

Dispatch a new route

post/fleetify/routes

Query parameters

keystring required

A key is a unique identifier that is required to authenticate a request to the API.

Request body

driver_emailstring required

Specify the e-mail address of the driver who should receive the route. The e-mail address must be registered in NextBillion.ai Cloud Console.

stepsRouteStepsRequest[] required— unresolved $ref

An array of objects to collect the details about the intermediate steps in the route to be dispatched. Each object corresponds to a single step. The array must begin with a start-type step and end with an end-type step, to form a valid route.

distanceinteger

Specify the total distance, in meters, for an informative display in Driver's app. The distance specified here has no effect on the actual route that the service generates.

document_template_idstring

Specify the ID of the document template that should be used to collect proof of completion for all steps in the route. In order to complete each route step, the driver will need to submit a form generated by the rules defined in the given document template. Use the Documents API to create, read and manage document templates.

Please note that the document template ID assigned to a route does not apply to following step types - start, end, break, layover.

ro_request_idstring

Specify the Route Optimization request ID. When this ID is provided, all other fields will be ignored (including the required fields) and the route optimization result will be used to form the routes and corresponding steps.

Please note that:

  • The driver's email ID must be provided in input vehicle.metadata as user_email such that the route optimization result must contain a valid driver email, step's arrival time, etc., to make a successful dispatch.

  • Document Template for collecting proof of delivery or completion can not be specified when using this field to dispatch a route.

  • In case of an error at any part among the routes, the API will immediately return the error with the index of the specific route or route step.

  • On a successful dispatch, the API returns the last route, if there are many, in the response payload.

Response

statusinteger

Returns the status code of the response.