How to construct a request in HERE Waypoints Sequence API v8
The basic elements of a request to the HERE Waypoints Sequence API v8 are:
- Start point
- Several destination points
- Routing mode
You can include a destination for sequence optimization. You must provide a destination for pickup along route. If the request doesn't contain a destination, one of the destination points you provide is chosen. Each point defining the start, a destination or the end consists of WaypointId, latitude and longitude in the WGS 84 system. For more information about the format, see the HERE Waypoints Sequence API v8 API Reference.
Using the parameter improvefor, you can define if to minimize the travel time or travel distance .
The mode parameter indicates whether the result is suitable for a car or a truck and whether to use traffic information when processing the request. In addition, mode defines whether individual interconnections are fastest or shortest. This setting is important for interaction with the routing APIs. Using fastest is recommended for most use cases. Be sure to provide a time for the departure if you enable traffic.
For authentication, one of the following parameters is mandatory:
apiKeybearer token- LEGACY:
app_idandapp_codecombination
Note
For the available authentication options, see the Identity and Access Management Developer Guide.
The table below lists the basic request elements with examples. Additionally, a request may contain more resource-specific parameters, such as parameters for truck specification. For more information about resource-specific parameters, see the HERE Waypoints Sequence API v8 API Reference.
| Element | Value/Example | Description |
|---|---|---|
| Legacy base URL | https://wse.api.here.com | Production environment for use with legacy authentication. |
| Base URL | https://wps.hereapi.com | Production environment only. |
| Path | /v8/ | The path consists of the major service version only. |
| Resource | findsequence.json, findpickups.json | GET or POST |
| Format of response | json | The format of the response is JSON. Usage of JSONP is supported. |
| Application code - Legacy | &app_code={YOUR_APP_CODE} | Substitute your own unique app_code. |
| Application ID - Legacy | &app_id={YOUR_APP_ID} | Substitute your own unique app_id. |
| API key | ?apiKey={YOUR_API_KEY} | Substitute your own unique API key. |
| Bearer token | Bearer TOKEN_HERE | Substitute your own unique bearer token. |
| Start point | &start= WiesbadenCentralStation;50.0715,8.2434 | First waypoint. |
| Intermediate destination | &destination1= FranfurtCentralStation;50.1073,8.6647 | The first of the waypoints. |
| Another intermediate destination | &destination2= DarmstadtCentralStation;49.8728,8.6326 | Adding further waypoints. |
| End point | &end=MainzCentralStation;50.0021,8.259 | The route end/destination. Optional for findsequence. If not provided, the service chooses a point from those provided in the request parameters. |
| Routing mode | &mode=fastest;car;traffic:enabled | Specifies the way interconnection routes are calculated. |
| Departure | &departure=2014-12-01T17:30:00+01:00 | Required if traffic:enabled; is set in the routing mode. |
| Optimization target | &improveFor=time | Specifies the target for optimizing the calculation results. Optional. |
| Request ID | &requestId=userGenerated85 | This ID is echoed in the result to allow for tracking the request through the service. Optional. |
Updated 7 days ago