{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/routing/request","auth":"required","settings":"576a36aadd4f320e0060b806","examples":{"codes":[{"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}","language":"json","name":"request - body"},{"code":"{\n  \"requestId\": \"24ba1548-7800-4e7d-8bc8-801f215fa99e\"\n}","language":"json","name":"response - success"},{"code":"{\n  \"error\": \"ID of a job should be string.\",\n  \"errorCode\": \"4001\"\n}","language":"json","name":"response - error"}]},"method":"post","params":[{"name":"drivers","type":"array_object","default":"","desc":"An array of all drivers. All drivers in this array will be assigned a route.","required":true,"in":"body","ref":"","_id":"57a04b9dcf8f650e00cccdb1"},{"name":"jobs","type":"array_object","default":"","desc":"An array of all all jobs.","required":true,"in":"body","ref":"","_id":"57a05c9e0c933e0e00249ba9"},{"name":"hardConstraints","type":"array_object","default":"","desc":"An array of constraints that need to be satisfied.","required":true,"in":"body","ref":"","_id":"57a05c9e0c933e0e00249ba8"},{"name":"softConstraints","type":"array_object","default":"","desc":"An array of constraints whose values need to be optimized.","required":true,"in":"body","ref":"","_id":"57a05c9e0c933e0e00249ba7"},{"name":"config","type":"object","default":"","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.","required":true,"in":"body","ref":"","_id":"57a05c9e0c933e0e00249ba6"},{"name":"routeRuleConfig","type":"object","default":"","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.","required":false,"in":"body","ref":"","_id":"57a05c9e0c933e0e00249ba5"},{"name":"x-api-key","type":"string","default":"","desc":"An API key.","required":true,"in":"header","ref":"","_id":"57a0759b1435850e00dfbc21"}],"results":{"codes":[{"name":"Success","code":"{\n  \"requestId\": String\n}","language":"json","status":"2XX"},{"name":"","code":"{\n  \"error\": String,\n  \"errorCode\": String\n}","language":"json","status":"4XX"}]}},"next":{"description":"","pages":[]},"title":"/routing/request","type":"endpoint","slug":"testinput","excerpt":"Create a new routing request","body":"","updates":[],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"574545346aa4860e00c2e193","createdAt":"2016-05-25T06:24:52.865Z","editedParams":true,"editedParams2":true,"githubsync":"","__v":7,"user":"57061c3e21cfed0e00e8c640","project":"5706099c21cfed0e00e8c60b","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Routing API","slug":"api","order":9999,"from_sync":false,"reference":false,"_id":"573548f4afab4417007239cf","__v":0,"project":"5706099c21cfed0e00e8c60b","version":"5706099c21cfed0e00e8c60e","createdAt":"2016-05-13T03:24:36.341Z"},"version":{"version":"1.0.17","version_clean":"1.0.17","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["5706099c21cfed0e00e8c60f","573548f4afab4417007239cf","57354970fc5f1e0e001a463c","573549791f16241700c89fc9","57441052583f470e000a7947","57a068f90c933e0e00249bae"],"_id":"5706099c21cfed0e00e8c60e","createdAt":"2016-04-07T07:17:48.808Z","hasDoc":true,"project":"5706099c21cfed0e00e8c60b","__v":6,"hasReference":true,"releaseDate":"2016-04-07T07:17:48.808Z"},"parentDoc":null}

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 }}