b647f1808dda
Dispatch a new route
Query parameters
A key is a unique identifier that is required to authenticate a request to the API.
Request body
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.
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.
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.
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.
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
Returns the status code of the response.