GuidesAPI Reference
Guides

How to request a truck waypoints sequence

A dispatcher needs to find the shortest way from the central station in Wiesbaden, Germany, to the central station in Mainz, Germany, that passes through the central stations in Frankfurt, Darmstadt, and Hanau.

A request to HERE Waypoints Sequence API v8 helps them determine in which order the truck should visit the destinations to travel the shortest possible distance.

The truck used in this calculation weighs 18t and hauls a trailer. The vehicle height is 4 m, width is 2,5 m, and total vehicle length is 18,35 m.

Request

curl -H "Authorization: Bearer BEARER_TOKEN" "https://wps.hereapi.com/v8/findsequence2?start=WiesbadenCentralStation;50.0715,8.2434&destination1=FranfurtCentralStation;50.1073,8.6647&destination2=DarmstadtCentralStation;49.8728,8.6326&destination3=HanauCentralStation;50.1218,8.9298&end=MainzCentralStation;50.0021,8.259&improveFor=distance&mode=fastest;truck;traffic:disabled;&hasTrailer=true&limitedWeight=18&height=4.00&width=2.50&length=18.35"

Response

{
  "results": [
    {
      "waypoints": [
        {
          "id": "WiesbadenCentralStation",
          "lat": 50.0715,
          "lng": 8.2434,
          "sequence": 0,
          "estimatedArrival": null,
          "estimatedDeparture": null,
          "fulfilledConstraints": []
        },
        {
          "id": "FranfurtCentralStation",
          "lat": 50.1073,
          "lng": 8.6647,
          "sequence": 1,
          "estimatedArrival": null,
          "estimatedDeparture": null,
          "fulfilledConstraints": []
        },
        {
          "id": "HanauCentralStation",
          "lat": 50.1218,
          "lng": 8.9298,
          "sequence": 2,
          "estimatedArrival": null,
          "estimatedDeparture": null,
          "fulfilledConstraints": []
        },
        {
          "id": "DarmstadtCentralStation",
          "lat": 49.8728,
          "lng": 8.6326,
          "sequence": 3,
          "estimatedArrival": null,
          "estimatedDeparture": null,
          "fulfilledConstraints": []
        },
        {
          "id": "MainzCentralStation",
          "lat": 50.0021,
          "lng": 8.259,
          "sequence": 4,
          "estimatedArrival": null,
          "estimatedDeparture": null,
          "fulfilledConstraints": []
        }
      ],
      "distance": "159694",
      "time": "8769",
      "interconnections": [
        {
          "fromWaypoint": "WiesbadenCentralStation",
          "toWaypoint": "FranfurtCentralStation",
          "distance": 36583,
          "time": 1846,
          "rest": 0,
          "waiting": 0
        },
        {
          "fromWaypoint": "FranfurtCentralStation",
          "toWaypoint": "HanauCentralStation",
          "distance": 34636,
          "time": 1917,
          "rest": 0,
          "waiting": 0
        },
        {
          "fromWaypoint": "HanauCentralStation",
          "toWaypoint": "DarmstadtCentralStation",
          "distance": 49221,
          "time": 2614,
          "rest": 0,
          "waiting": 0
        },
        {
          "fromWaypoint": "DarmstadtCentralStation",
          "toWaypoint": "MainzCentralStation",
          "distance": 39254,
          "time": 2392,
          "rest": 0,
          "waiting": 0
        }
      ],
      "description": "Targeted best distance; without traffic",
      "timeBreakdown": {
        "driving": 8769,
        "service": 0,
        "rest": 0,
        "waiting": 0,
        "break": 0
      }
    }
  ],
  "errors": [],
  "processingTimeDesc": "129ms",
  "responseCode": "200",
  "warnings": null,
  "requestId": "f12b6053-612b-460a-8e86-e5fccf88016d"
}