{"_id":"574545346aa4860e00c2e193","editedParams":true,"editedParams2":true,"githubsync":"","__v":7,"user":"57061c3e21cfed0e00e8c640","project":"5706099c21cfed0e00e8c60b","category":{"_id":"573548f4afab4417007239cf","__v":0,"project":"5706099c21cfed0e00e8c60b","version":"5706099c21cfed0e00e8c60e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-13T03:24:36.341Z","from_sync":false,"order":9999,"slug":"api","title":"Routing API"},"version":{"_id":"5706099c21cfed0e00e8c60e","hasDoc":true,"project":"5706099c21cfed0e00e8c60b","__v":6,"hasReference":true,"createdAt":"2016-04-07T07:17:48.808Z","releaseDate":"2016-04-07T07:17:48.808Z","categories":["5706099c21cfed0e00e8c60f","573548f4afab4417007239cf","57354970fc5f1e0e001a463c","573549791f16241700c89fc9","57441052583f470e000a7947","57a068f90c933e0e00249bae"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.17","version":"1.0.17"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-25T06:24:52.865Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"576a36aadd4f320e0060b806","examples":{"codes":[{"name":"request - body","language":"json","code":"{\n\t\"drivers\": [\n  \t{\n      \"id\": \"D1\",\n      \"maxCapacity\": {\n        \"data\": {\n          \"Volume\": 1000000.0\n        }\n      },\n      \"startTime\": {\n        \"epoch\": 1455356400\n      },\n      \"endTime\": {\n        \"epoch\": 1455375540\n      },\n      \"skillLevel\": 0,\n      \"vehicleFeatures\": [],\n      \"maxWaitTime\": {\n        \"seconds\": 0\n      }\n    }\n  ],\n  \"jobs\": [\n    {\n      \"id\": \"j1\",\n      \"tasks\": [\n      {\n        \"id\": \"t1\",\n        \"jobId\": \"j1\",\n        \"taskType\": \"DepotDelivery\",\n        \"location\": {\n          \"labels\": [\n            \"15823\"\n          ],\n          \"x\": 126.9,\n          \"y\": 37.3\n        },\n        \"capacity\": {\n          \"data\": {\n            \"Volume\": 62400.0\n          }\n        },\n        \"taskDuration\": {\n          \"seconds\": 300\n        },\n        \"timeWindow\": {\n          \"start\": {\n            \"epoch\": 1455357600\n          },\n          \"end\": {\n            \"epoch\": 1455368400\n          }\n        },\n        \"difficulty\": 0\n      }],\n      \"partialOrder\": []\n    }\n  ],\n  \"hardConstraints\": [\n    {\n  \t  \"type\": \"TimeWindowConstraint\",\n      \"weight\": 1.0\n    }\n  ],\n  \"softConstraints\": [\n    {\n      \"type\": \"CapacityConstraint\",\n      \"weight\": 100.0\n    }\n  ],\n  \"config\": {\n    \"gis\": {\n      \"type\": \"SimpleGIS\",\n      \"drivingFactor\": 1.26,\n      \"averageSpeed\": 40.0\n    },\n    \"depot\": {\n      \"id\": \"depot1\",\n      \"location\": {\n        \"labels\": [],\n        \"x\": 127.1,\n        \"y\": 37.3\n      }\n    },\n    \"returnToDepot\": true\n  },\n  \"routeRuleConfig\": {\n  \t\"ruleCode\": \"2f311a1b-2b52-5024-4bf1-8dc5294aa421\"\n  }\n}"},{"name":"response - success","language":"json","code":"{\n  \"requestId\": \"24ba1548-7800-4e7d-8bc8-801f215fa99e\"\n}"},{"name":"response - error","language":"json","code":"{\n  \"error\": \"ID of a job should be string.\",\n  \"errorCode\": \"4001\"\n}"}]},"method":"post","results":{"codes":[{"status":"2XX","language":"json","code":"{\n  \"requestId\": String\n}","name":"Success"},{"status":"4XX","language":"json","code":"{\n  \"error\": String,\n  \"errorCode\": String\n}","name":""}]},"auth":"required","params":[{"_id":"57a04b9dcf8f650e00cccdb1","ref":"","in":"body","required":true,"desc":"An array of all drivers. All drivers in this array will be assigned a route.","default":"","type":"array_object","name":"drivers"},{"_id":"57a05c9e0c933e0e00249ba9","ref":"","in":"body","required":true,"desc":"An array of all all jobs.","default":"","type":"array_object","name":"jobs"},{"_id":"57a05c9e0c933e0e00249ba8","ref":"","in":"body","required":true,"desc":"An array of constraints that need to be satisfied.","default":"","type":"array_object","name":"hardConstraints"},{"_id":"57a05c9e0c933e0e00249ba7","ref":"","in":"body","required":true,"desc":"An array of constraints whose values need to be optimized.","default":"","type":"array_object","name":"softConstraints"},{"_id":"57a05c9e0c933e0e00249ba6","ref":"","in":"body","required":true,"desc":"A configuration for the routing problem. Can specify GIS (REQUIRED), the location of the depot and whether the drivers have to return to the depot after they finish their job.","default":"","type":"object","name":"config"},{"_id":"57a05c9e0c933e0e00249ba5","ref":"","in":"body","required":false,"desc":"A configuration for route rule. Can specify rule code to use and its weight. Refer to \"Experience Mining\" and \"Problems and Solutions\" section for more information.","default":"","type":"object","name":"routeRuleConfig"},{"_id":"57a0759b1435850e00dfbc21","ref":"","in":"header","required":true,"desc":"An API key.","default":"","type":"string","name":"x-api-key"}],"url":"/routing/request"},"isReference":false,"order":0,"body":"","excerpt":"Create a new routing request","slug":"testinput","type":"endpoint","title":"/routing/request"}

post/routing/request

Create a new routing request

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

drivers:
required
array of objects
An array of all drivers. All drivers in this array will be assigned a route.
jobs:
required
array of objects
An array of all all jobs.
hardConstraints:
required
array of objects
An array of constraints that need to be satisfied.
softConstraints:
required
array of objects
An array of constraints whose values need to be optimized.
config:
required
object
A configuration for the routing problem. Can specify GIS (REQUIRED), the location of the depot and whether the drivers have to return to the depot after they finish their job.
routeRuleConfig:
object
A configuration for route rule. Can specify rule code to use and its weight. Refer to "Experience Mining" and "Problems and Solutions" section for more information.

Headers

x-api-key:
required
string
An API key.

Examples


Result Format


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}