Routing API Developer's Guide

Requesting Matrix Calculation using POST method

POST method is supported only partially: only start and destinations points in the same format as in the REST URL can be send in POST body. This however allows to send larger amount of points than in REST method (main issue is that there is a length limitation for URLs). Using wget there are two ways of sending POST body:
  • POST body from file (Note: check in hex editor if at the end of file is dot sign '.' if it exists then it must be removed or it will cause error response from server)
  • POST body from string

The following example demonstrates a request of a matrix of routes for one start and two destinations points using POST body from string and setting output filename with -O switch.

wget "https://matrix.route.cit.api.here.com/routing/7.2/calculatematrix.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&mode=fastest;pedestrian;traffic:disabled"
--post-data="start0=52.43%2C13.4&destination0=52.5%2C13.43&destination1=52.5%2C13.46"
-O output.json

The following example demonstrates a request of a matrix of routes for one start and two destinations points using POST body from file and setting output filename with -O switch.

wget "https://matrix.route.cit.api.here.com
/routing/7.2/calculatematrix.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&mode=fastest;pedestrian;traffic:disabled"
--post-file=points.txt
-O output.json

Contents of file points.txt:

start0=52.43%2C13.4&destination0=52.5%2C13.43&destination1=52.5%2C13.46

Both examples result in the same response:

{
  response: {
  metaInfo: { /*content omitted*/ },
  matrixEntry: [
    {
    startIndex: 0,
    destinationIndex: 0,
    summary: { costFactor: 9462 }
    },
    {
    startIndex: 0,
    destinationIndex: 1,
    summary: { costFactor: 10600 }
    }
  ]
  }
}

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.