Sorry, you need to enable JavaScript to visit this website.

Batch Routing

Dispatch batches of Routing requests with ease.

Asynchronous and synchronous batch processing

You can call Batch Routing APIs to run either synchronously or asynchronously.

Asynchronous API overview

The asynchronous API is appropriate for processing big volumes of relatively complex routing requests. It allows retrieval of processing results in a separate call (multiple downloads are possible). The asynchronous API is optimized for reliability and is not expected to run into a timeout. A number of batch items is limited to 700 for this API.

Data retention period notice

Please, be aware that batches processed by asynchronous API are available for download for 14 days, after which request for results download will return 404 (Not Found) response.

Sequence of asynchronous API client actions

  1. Client sends a request to the asynchronous batch submission endpoint.
  2. The server will respond with one of the following:
  3. After getting an HTTP 303 response, the client should follow the redirect to the asynchronous batch download endpoint which is a blocking long poll request.
  4. When client calls the asynchronous batch download endpoint, then possible scenarios are:
    • Batch response is calculated before timeout (120 seconds). The client receives HTTP 200. Batch response is ready and it gets streamed to the client.
    • Batch response is not ready before timeout. The client receives HTTP 202. Batch request is accepted for processing. The client downloads batch results from the URL specified by the Location header (see point 3).

Synchronous API overview

The synchronous API is recommended for lightweight routing requests with quickly-expiring results (e.g. due to changing traffic conditions). In such a case, when the service receives a request, it will respond as soon as the routes of the batch are calculated and there will be no possibility to retrieve the results later on.
The synchronous API will return a timeout error, if the request takes longer than 60 seconds. A number of batch items is limited to 100 for this API.

Sequence of synchronous API client actions

  1. Client sends a request to the synchronous batch endpoint.
  2. The server will respond with one of the following:
    • HTTP 200 Batch processing result - the calculation is finished before timeout and the client downloads results straight away.
    • HTTP 408 Request timeout error, if the request takes longer than 60 seconds and cannot be finished in this timeframe.
    • HTTP another error (see synchronous batch HTTP status codes).

 

Asynchronous batch submission endpoint

This endpoint allows submitting a new batch for asynchronous processing. It responds with a redirect to the location at which the batch results can be obtained when the batch processing has completed.

Batch submission request

HTTP method and URL

POST https://<baseURL>/routing/<versionNumber>/batch[/<outputFormat>]?key=<APIKEY>

Example

https://api.tomtom.com/routing/1/batch/xml?key=<APIKEY>

HTTP Headers

The table below describes HTTP request headers of particular interest to Batch Routing service clients. Required headers must be used or the call will fail. Optional headers, which are highlighted with [square brackets], may be used. If there is a default value that will be assumed when an optional header is not used, it is shown in the table. The order of request headers is not important.

Header Description Req'd? Values Default Value
Content-Type Specifies the MIME type of the body of the request. Yes
  • application/xml
  • application/json

 

Parameters

The table below describes the parameters that can be used in a request. Required parameters must be used or the call will fail. Optional parameters, which are highlighted with [square brackets], may be used. If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table. The order of request parameters is not important.

Parameter Description Req'd? Type / Values Default Value Max Value
baseURL Base URL for calling the API. Yes api.tomtom.com
versionNumber Service version number. The current value is 1. Yes 1
key Authorization key for access to the API. Yes API Key
[outputFormat] The content type of the response structure. No
  • xml
  • json
xml

 

POST body

The POST body of batch request should contain a set of items which will be used to execute requests to the Routing service.

POST body format

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchRequest>
    <batchItems>
        <batchItem>
            <query>...</query>
        </batchItem>
        ...
        <batchItem>
            <query>...</query>
            <post>...</post>
        </batchItem>
    </batchItems>
</batchRequest>

JSON:

{
  "batchItems": [
    {"query": "..."},
    ....
    {
        "query": "..."
        "post": {...}
    }
  ]
}

POST body fields

Field Description
batchRequest Root element of the request.
batchItems A set of batch items. Maximum number of batch items for asynchronous API is 700.
batchItem A single batch item.
query A string used to build a request to the Routing service. It is a partial URL without protocol, base URL, service version or API key parts. The output format (last path element) must match the outputFormat parameter of the batch request. When posting XML to the Batch Routing service the <query> element values must be valid XML (e.g. & character must be replaced by predefined XML entity &amp;). More information in List of XML character entity references.

When posting JSON to the Batch Routing service the query string values must be properly escaped (e.g. " character should be escaped with \). More information is available in RFC7159.

Please note that the callback parameter is not supported by Batch Routing. For detailed descriptions refer to the documentation of Calculate Route and Calculate Reachable Range services.

post Contains data that is passed to Calculate Route or Calculate Reachable Range services using the HTTP POST method. The POST data format must match the Content-Type header of a submitted batch request i.e. it should be in the JSON format when Content-Type is set to "application/json" and should be in the XML format if Content-Type is set to "application/xml".
Please refer to POST Data Parameters section of Calculate Route and Calculate Reachable Range services documentation for detailed descriptions and examples of XML and JSON content for this field.

POST body example

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchRequest>
  <batchItems>
    <batchItem>
      <query>/calculateRoute/52.36006039665441,4.851064682006836:52.36187528311709,4.850560426712036/xml?travelMode=car&amp;routeType=shortest&amp;traffic=true&amp;departAt=now&amp;maxAlternatives=0</query>
    </batchItem>
    <batchItem>
      <query>/calculateRoute/52.36241907934766,4.850034713745116:52.36173769505809,4.852169752120972/xml?travelMode=teleport&amp;routeType=shortest&amp;traffic=true&amp;departAt=now</query>
    </batchItem>
    <batchItem>
      <query>/calculateRoute/52.23292,21.06179:43.29379,17.01963/xml</query>
      <post>
        <postData>
          <avoidVignette>
            AUS,CHE
          </avoidVignette>
        </postData>
      </post>
    </batchItem>
    <batchItem>
      <query>/calculateReachableRange/52.36187528311709,4.850560426712036/xml?fuelBudgetInLiters=20&amp;constantSpeedConsumptionInLitersPerHundredkm=50,6</query>
    </batchItem>
    <batchItem>
      <query>/calculateReachableRange/52.36173769505809,4.852169752120972/xml?timeBudgetInSec=1800</query>
    </batchItem>
  </batchItems>
</batchRequest>

JSON:

{
  "batchItems": [
    {"query": "/calculateRoute/52.36006039665441,4.851064682006836:52.36187528311709,4.850560426712036/json?travelMode=car&routeType=shortest&traffic=true&departAt=now&maxAlternatives=0"},
    {"query": "/calculateRoute/52.36241907934766,4.850034713745116:52.36173769505809,4.852169752120972/json?travelMode=teleport&routeType=shortest&traffic=true&departAt=now"},
    {
      "query": "/calculateRoute/52.23292,21.06179:43.29379,17.01963/json",
      "post": {
        "avoidVignette": [
          "AUS",
          "CHE"
        ]
      }
    },
    {"query": "/calculateReachableRange/52.36187528311709,4.850560426712036/json?fuelBudgetInLiters=20&constantSpeedConsumptionInLitersPerHundredkm=50,6"},
    {"query": "/calculateReachableRange/52.36173769505809,4.852169752120972/json?timeBudgetInSec=1800"}
  ]
}

 

Batch submission response

On a successful batch request submission the Batch Routing service responds with an HTTP 303 redirect to batch download endpoint. Response has a Location header with link to that endpoint and no body. In case of error a body is present.

HTTP Status Codes

Code Meaning and Possible Causes
303

See Other: an HTTP redirect to the location where the batch results can be obtained.

400 Bad Request: Missing required parameters, exceeded maximum number of batch items or parameters didn't pass validation.
403 Forbidden: The API key is missing, inactive, invalid, not entitled to use the Batch Routing API, over QPS or over QPD. Can also occur when using HTTP instead of HTTPS.
404 Not Found: the requested resource could not be found, but it may be available again in the future.
405 Method Not Allowed: the client used an HTTP method other than POST.
408 Request timeout.
414 Requested URI is too long.
500 An error occurred while processing the request. Please try again later.
502 Internal network connectivity issue. Please try again later.
503 Service currently unavailable. Please try again later.
504 Internal network connectivity issue or a request that has taken too long to complete. Please try again later.
596 Service not found. Request contains an incorrect FQDN and/or path.

 

HTTP Headers

Header Description Values
Location Indicates the location where the batch results can be downloaded. URI
Access-Control-Expose-Headers A comma separated list of HTTP header names that browsers are allowed to access. Content-Length
Access-Control-Allow-Origin A header instructing browsers to allow customer websites to contact the Batch Routing service. *
Content-Encoding The Batch Routing service applies gzip compression to the responses, if it is requested by the client with the Accept-Encoding header. gzip
Content-Type The format of the response as chosen by the client (see the contentType request parameter).
  • application/xml; charset=utf-8
  • application/json; charset=utf-8

 

Error response example

The submission endpoint will return error responses with content type depending on the outputFormat parameter.

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchResponse xmlns="http://api.tomtom.com/batch" formatVersion="0.0.1">
    <error description="Output format: csv is unsupported."/>
</batchResponse>

JSON:

{
  "formatVersion": "0.0.1",
  "error": {
    "description": "Output format: csv is unsupported."
  }
}

Error response fields

Field Description
batchResponse Root element of the batch error response.
formatVersion Version of batch error response format.
error Element describing the error.
description Description string.

 

Asynchronous batch download endpoint

This endpoint fetches results of the asynchronous batch processing. It responds with HTTP 200 and the batch results assuming batch processing has completed, or HTTP 202 Accepted if the batch is still being processed. HTTP 202 Accepted will be obtained after 120 s, then client should retry request by following the Location header. An HTTP 200 response does not indicate that every batch item succeeded, only that the batch calculation was completed. Detailed information about the success or failure of the individual requests within the batch is provided in the HTTP 200 response.

The batch download GET request is a blocking long poll request.

Batch download request

HTTP method and URL

GET https://<baseURL>/routing/<versionNumber>/batch/<batchId>?key=<APIKEY>

Example

https://api.tomtom.com/routing/1/batch/<batchId>?key=<APIKEY>

HTTP Headers

The table below describes HTTP request headers of particular interest to Batch Routing service clients. Required headers must be used or the call will fail. Optional headers, which are highlighted with [square brackets], may be used. If there is a default value that will be assumed when an optional header is not used, it is shown in the table. The order of request headers is not important.

Header Description Req'd? Values Default Value
[Accept-Encoding] Should contain list of encodings acceptable by the client. Usually used to demand a compressed response. No gzip

Parameters

The table below describes the parameters that can be used in a request. Required parameters must be used or the call will fail. Optional parameters, which are highlighted with [square brackets], may be used. If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table. The order of request parameters is not important.

Parameter Description Req'd? Type / Values Default Value Max Value
baseURL Base URL for calling the API. Yes api.tomtom.com
versionNumber Service version number. The current value is 1. Yes 1
key Authorization key for access to the API. Yes API Key
batchId Unique id of the batch, returned in HTTP 303 See Other HTTP Location header of Batch Submission response. Yes String

 

Batch download response

HTTP Status Codes

Code Meaning and Possible Causes
200 OK: The batch job has completed. Results are streamed to client.
202 Accepted: The request has been accepted for processing, but the processing has not been completed. A Location header is added to the response containing a link to retry later.
400 Bad Request: Missing required parameters or parameters didn't pass validation.
403 Forbidden: The API key is missing, inactive, invalid, not entitled to use the Batch Routing API, over QPS or over QPD. Can also occur when using HTTP instead of HTTPS.
404 Not Found: the requested resource could not be found, for example a batch with provided batchId does not exist.
405 Method Not Allowed: the client used an HTTP method other than GET.
408 Request timeout.
414 Requested URI is too long.
500 An error occurred while processing the request. Please try again later.
502 Internal network connectivity issue. Please try again later.
503 Service currently unavailable. Please try again later.
504 Internal network connectivity issue or a request that has taken too long to complete. Please try again later.
596 Service not found. Request contains an incorrect FQDN and/or path.

 

HTTP Headers

The table below lists HTTP response headers of particular interest to the Batch Routing service clients.

Header Description Values
Location Indicates the location where the batch results can be downloaded. Available only if the response is HTTP 202. URI
Access-Control-Expose-Headers A comma separated list of HTTP header names that browsers are allowed to access. Content-Length
Access-Control-Allow-Origin A header instructing browsers to allow customer websites to contact the Batch Routing service. *
Content-Encoding The Batch Routing service applies gzip compression to the responses, if it is requested by the client with the Accept-Encoding header. gzip
Content-Type The format of the response as chosen by the client (see the contentType request parameter).
  • application/xml; charset=utf-8
  • application/json; charset=utf-8

 

Successful response structure

Each batch response consists of one or more <batchItem> elements which correspond sequentially with the <batchItem> elements in the request. Each <batchItem> element contains a successful response from the invoked Online Routing API or a status code indicating why the batch item failed.

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchResponse xmlns="http://api.tomtom.com/batch" formatVersion="0.0.1">
    <batchItems>
        <batchItem>
            <statusCode>...</statusCode>
            <response>
                ...
            </response>
        </batchItem>
        ...
        <batchItem>
            <statusCode>...</statusCode>
            <response>
                ...
            </response>
        </batchItem>
    </batchItems>
    <summary>
        <successfulRequests>...</successfulRequests>
        <totalRequests>...</totalRequests>
    </summary>
</batchResponse>

JSON:

{
    "formatVersion": "0.0.1",
    "batchItems": [
        {
            "statusCode": ...,
            "response": {...}
        },
        ...,
        {
            "statusCode": ...,
            "response": {...}
        }
    ],
    "summary": {
        "successfulRequests": ...,
        "totalRequests": ...
    }
}

Successful response fields

Field Description
batchResponse Root element of the batch response.
successfulRequests Number of successful batch item requests.
totalRequests Total number of items in batch request.
batchItems A set of batch items processing results.
batchItem Contains results of processing of a single batch item.
statusCode Status code of a response from the Routing endpoint for given batch item.
response Content of the response from the Routing endpoint for given batch item query. The full response content will be included both in case of success and failure.
If the underlying service's response content type does not match requested content type, then the response will be wrapped to fit the requested content type.
summary Summary of the batch request.

Successful response example

To improve readability of the examples, the copyright and privacy sections inside batch items' response are skipped.

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchResponse xmlns="http://api.tomtom.com/batch" formatVersion="0.0.1">
    <batchItems>
        <batchItem>
            <statusCode>200</statusCode>
            <response>
                <calculateRouteResponse xmlns="http://api.tomtom.com/routing" formatVersion="0.0.12"><copyright>...</copyright><privacy>...</privacy><route><summary><lengthInMeters>223</lengthInMeters><travelTimeInSeconds>66</travelTimeInSeconds><trafficDelayInSeconds>0</trafficDelayInSeconds><departureTime>2016-04-22T13:21:30+02:00</departureTime><arrivalTime>2016-04-22T13:22:36+02:00</arrivalTime></summary><leg><summary><lengthInMeters>223</lengthInMeters><travelTimeInSeconds>66</travelTimeInSeconds><trafficDelayInSeconds>0</trafficDelayInSeconds><departureTime>2016-04-22T13:21:30+02:00</departureTime><arrivalTime>2016-04-22T13:22:36+02:00</arrivalTime></summary><points><point latitude="52.36006" longitude="4.85109"/><point latitude="52.36084" longitude="4.85106"/><point latitude="52.36176" longitude="4.85104"/><point latitude="52.36176" longitude="4.85056"/></points></leg><sections><section><startPointIndex>0</startPointIndex><endPointIndex>3</endPointIndex><travelMode>car</travelMode></section></sections></route></calculateRouteResponse>
            </response>
        </batchItem>
        <batchItem>
            <statusCode>400</statusCode>
            <response>
                <calculateRouteResponse xmlns="http://api.tomtom.com/routing" formatVersion="0.0.12"><copyright>...</copyright><privacy>...</privacy><error description="Invalid travel mode value: [teleport]"/></calculateRouteResponse>
            </response>
        </batchItem>
        <batchItem>
            <statusCode>200</statusCode>
            <response>
                <calculateReachableRangeResponse xmlns="http://api.tomtom.com/routing" formatVersion="0.0.1"><copyright>...</copyright><privacy>...</privacy><reachableRange><center latitude="52.36176" longitude="4.85056"/><boundary><point latitude="52.78716" longitude="4.81318"/><point latitude="52.78983" longitude="4.79019"/><point latitude="52.78346" longitude="4.70485"/><point latitude="52.77541" longitude="4.67377"/><point latitude="52.73947" longitude="4.64530"/><point latitude="52.61481" longitude="4.64891"/><point latitude="52.61362" longitude="4.64887"/><point latitude="52.53855" longitude="4.65841"/><point latitude="52.49834" longitude="4.64125"/><point latitude="52.47165" longitude="4.60932"/><point latitude="52.46203" longitude="4.58628"/><point latitude="52.44705" longitude="4.59327"/><point latitude="52.37132" longitude="4.52544"/><point latitude="52.32164" longitude="4.57722"/><point latitude="52.26437" longitude="4.45996"/><point latitude="52.11393" longitude="4.28383"/><point latitude="51.01315" longitude="2.37788"/><point latitude="51.02757" longitude="2.42521"/><point latitude="50.43132" longitude="2.84907"/><point latitude="50.33847" longitude="2.92668"/><point latitude="50.34035" longitude="3.46896"/><point latitude="50.45216" longitude="3.76045"/><point latitude="50.48706" longitude="4.08585"/><point latitude="50.13129" longitude="4.49675"/><point latitude="50.49117" longitude="4.61820"/><point latitude="50.09545" longitude="5.13195"/><point latitude="50.05438" longitude="5.20811"/><point latitude="50.02166" longitude="5.69731"/><point latitude="50.07049" longitude="5.73492"/><point latitude="50.21669" longitude="6.23432"/><point latitude="50.11697" longitude="6.43576"/><point latitude="50.46513" longitude="6.70010"/><point latitude="50.37483" longitude="7.41121"/><point latitude="50.52358" longitude="7.67539"/><point latitude="50.87047" longitude="7.96531"/><point latitude="51.02269" longitude="7.82893"/><point latitude="51.54443" longitude="8.10810"/><point latitude="52.23340" longitude="9.25347"/><point latitude="52.86505" longitude="8.23947"/><point latitude="52.95622" longitude="8.56608"/><point latitude="53.18553" longitude="8.10646"/><point latitude="53.32431" longitude="6.87906"/><point latitude="53.24864" longitude="6.46143"/><point latitude="53.21977" longitude="5.98597"/><point latitude="53.20076" longitude="5.64319"/><point latitude="53.18381" longitude="5.45848"/><point latitude="53.03505" longitude="5.23428"/><point latitude="52.95193" longitude="5.07620"/><point latitude="52.77310" longitude="4.95600"/><point latitude="52.73059" longitude="4.89175"/></boundary></reachableRange></calculateReachableRangeResponse>
            </response>
        </batchItem>
        <batchItem>
            <statusCode>200</statusCode>
            <response>
                <calculateReachableRangeResponse xmlns="http://api.tomtom.com/routing" formatVersion="0.0.1"><copyright>...</copyright><privacy>...</privacy><reachableRange><center latitude="52.36178" longitude="4.85216"/><boundary><point latitude="52.55238" longitude="4.83100"/><point latitude="52.58994" longitude="4.81431"/><point latitude="52.61593" longitude="4.75696"/><point latitude="52.61907" longitude="4.73098"/><point latitude="52.60065" longitude="4.72924"/><point latitude="52.57070" longitude="4.69273"/><point latitude="52.56251" longitude="4.66643"/><point latitude="52.51827" longitude="4.65113"/><point latitude="52.51005" longitude="4.65357"/><point latitude="52.47165" longitude="4.60932"/><point latitude="52.46203" longitude="4.58628"/><point latitude="52.44705" longitude="4.59327"/><point latitude="52.36490" longitude="4.57865"/><point latitude="52.32644" longitude="4.58989"/><point latitude="52.27725" longitude="4.51188"/><point latitude="52.17816" longitude="4.40562"/><point latitude="52.13246" longitude="4.39854"/><point latitude="52.07782" longitude="4.40456"/><point latitude="52.12844" longitude="4.54478"/><point latitude="52.14059" longitude="4.65627"/><point latitude="52.13539" longitude="4.69158"/><point latitude="52.18747" longitude="4.76277"/><point latitude="52.24121" longitude="4.81595"/><point latitude="52.25268" longitude="4.82480"/><point latitude="52.22580" longitude="4.85207"/><point latitude="52.22231" longitude="4.86311"/><point latitude="52.11528" longitude="4.91272"/><point latitude="52.10137" longitude="4.91745"/><point latitude="52.15657" longitude="4.95490"/><point latitude="52.07171" longitude="5.03885"/><point latitude="52.03613" longitude="5.06388"/><point latitude="52.06045" longitude="5.09947"/><point latitude="52.12534" longitude="5.11099"/><point latitude="52.23269" longitude="5.04984"/><point latitude="52.17824" longitude="5.18006"/><point latitude="52.20486" longitude="5.27330"/><point latitude="52.21371" longitude="5.33380"/><point latitude="52.35807" longitude="5.35599"/><point latitude="52.41557" longitude="5.38758"/><point latitude="52.37996" longitude="4.97327"/><point latitude="52.39278" longitude="4.96466"/><point latitude="52.45905" longitude="5.03088"/><point latitude="52.49351" longitude="5.03124"/><point latitude="52.54294" longitude="5.02473"/><point latitude="52.65326" longitude="5.07318"/><point latitude="52.67429" longitude="5.07021"/><point latitude="52.72101" longitude="5.02531"/><point latitude="52.63597" longitude="4.95650"/><point latitude="52.54702" longitude="4.87765"/><point latitude="52.54899" longitude="4.86904"/></boundary></reachableRange></calculateReachableRangeResponse>
            </response>
        </batchItem>
    </batchItems>
    <summary>
        <successfulRequests>3</successfulRequests>
        <totalRequests>4</totalRequests>
    </summary>
</batchResponse>

JSON:

{
    "formatVersion": "0.0.1",
    "batchItems": [
        {
            "statusCode": 200,
            "response": {"formatVersion":"0.0.12","copyright":"...","privacy":"...","routes":[{"summary":{"lengthInMeters":223,"travelTimeInSeconds":66,"trafficDelayInSeconds":0,"departureTime":"2016-04-22T13:43:25+02:00","arrivalTime":"2016-04-22T13:44:31+02:00"},"legs":[{"summary":{"lengthInMeters":223,"travelTimeInSeconds":66,"trafficDelayInSeconds":0,"departureTime":"2016-04-22T13:43:25+02:00","arrivalTime":"2016-04-22T13:44:31+02:00"},"points":[{"latitude":52.36006,"longitude":4.85109},{"latitude":52.36084,"longitude":4.85106},{"latitude":52.36176,"longitude":4.85104},{"latitude":52.36176,"longitude":4.85056}]}],"sections":[{"startPointIndex":0,"endPointIndex":3,"travelMode":"car"}]}]}
        },
        {
            "statusCode": 400,
            "response": {"formatVersion":"0.0.12","copyright":"...","privacy":"...","error":{"description":"Invalid travel mode value: [teleport]"}}
        },
        {
            "statusCode": 200,
            "response":{"formatVersion":"0.0.1","copyright":"...","privacy":"...","reachableRange":{"center":{"latitude":52.36176,"longitude":4.85056},"boundary":[{"latitude":52.78716,"longitude":4.81318},{"latitude":52.78983,"longitude":4.79019},{"latitude":52.78346,"longitude":4.70485},{"latitude":52.77541,"longitude":4.67377},{"latitude":52.73947,"longitude":4.6453},{"latitude":52.61481,"longitude":4.64891},{"latitude":52.61362,"longitude":4.64887},{"latitude":52.53855,"longitude":4.65841},{"latitude":52.49834,"longitude":4.64125},{"latitude":52.47165,"longitude":4.60932},{"latitude":52.46203,"longitude":4.58628},{"latitude":52.44705,"longitude":4.59327},{"latitude":52.37132,"longitude":4.52544},{"latitude":52.32164,"longitude":4.57722},{"latitude":52.26437,"longitude":4.45996},{"latitude":52.11393,"longitude":4.28383},{"latitude":50.98539,"longitude":2.23052},{"latitude":50.98863,"longitude":2.35777},{"latitude":50.43132,"longitude":2.84907},{"latitude":50.33847,"longitude":2.92668},{"latitude":50.22934,"longitude":3.27133},{"latitude":50.45216,"longitude":3.76045},{"latitude":50.48706,"longitude":4.08585},{"latitude":49.98206,"longitude":4.51402},{"latitude":50.49117,"longitude":4.6182},{"latitude":50.09545,"longitude":5.13195},{"latitude":49.91044,"longitude":5.29447},{"latitude":50.02166,"longitude":5.69731},{"latitude":50.07049,"longitude":5.73492},{"latitude":50.21669,"longitude":6.23432},{"latitude":50.11697,"longitude":6.43576},{"latitude":50.46513,"longitude":6.7001},{"latitude":50.37483,"longitude":7.41121},{"latitude":50.52358,"longitude":7.67539},{"latitude":50.87047,"longitude":7.96531},{"latitude":51.02269,"longitude":7.82893},{"latitude":51.54443,"longitude":8.1081},{"latitude":52.2334,"longitude":9.25347},{"latitude":52.86505,"longitude":8.23947},{"latitude":52.95622,"longitude":8.56608},{"latitude":53.18553,"longitude":8.10646},{"latitude":53.32431,"longitude":6.87906},{"latitude":53.24864,"longitude":6.46143},{"latitude":53.21977,"longitude":5.98597},{"latitude":53.20076,"longitude":5.64319},{"latitude":53.18381,"longitude":5.45848},{"latitude":53.03505,"longitude":5.23428},{"latitude":52.95193,"longitude":5.0762},{"latitude":52.7731,"longitude":4.956},{"latitude":52.73059,"longitude":4.89175}]}}
        },
        {
            "statusCode": 200,
            "response":{"formatVersion":"0.0.1","copyright":"...","privacy":"...","reachableRange":{"center":{"latitude":52.36178,"longitude":4.85216},"boundary":[{"latitude":52.55238,"longitude":4.831},{"latitude":52.58944,"longitude":4.81481},{"latitude":52.61593,"longitude":4.75696},{"latitude":52.61869,"longitude":4.73182},{"latitude":52.60065,"longitude":4.72924},{"latitude":52.5704,"longitude":4.69259},{"latitude":52.56248,"longitude":4.66803},{"latitude":52.51754,"longitude":4.65152},{"latitude":52.51005,"longitude":4.65357},{"latitude":52.47165,"longitude":4.60932},{"latitude":52.46203,"longitude":4.58628},{"latitude":52.44705,"longitude":4.59327},{"latitude":52.40392,"longitude":4.54964},{"latitude":52.34494,"longitude":4.58513},{"latitude":52.27725,"longitude":4.51188},{"latitude":52.17925,"longitude":4.40661},{"latitude":52.13387,"longitude":4.40049},{"latitude":52.08084,"longitude":4.4085},{"latitude":52.12844,"longitude":4.54478},{"latitude":52.14113,"longitude":4.6569},{"latitude":52.13626,"longitude":4.69284},{"latitude":52.18881,"longitude":4.76185},{"latitude":52.24121,"longitude":4.81595},{"latitude":52.25268,"longitude":4.8248},{"latitude":52.2258,"longitude":4.85207},{"latitude":52.22231,"longitude":4.86311},{"latitude":52.11528,"longitude":4.91272},{"latitude":52.10203,"longitude":4.91813},{"latitude":52.15657,"longitude":4.9549},{"latitude":52.07171,"longitude":5.03885},{"latitude":52.03868,"longitude":5.06395},{"latitude":52.06083,"longitude":5.09541},{"latitude":52.12659,"longitude":5.1081},{"latitude":52.23269,"longitude":5.04984},{"latitude":52.17824,"longitude":5.18006},{"latitude":52.20553,"longitude":5.27285},{"latitude":52.21432,"longitude":5.33036},{"latitude":52.35769,"longitude":5.3551},{"latitude":52.4155,"longitude":5.38742},{"latitude":52.37996,"longitude":4.97327},{"latitude":52.39278,"longitude":4.96466},{"latitude":52.45905,"longitude":5.03088},{"latitude":52.49351,"longitude":5.03124},{"latitude":52.54294,"longitude":5.02473},{"latitude":52.65356,"longitude":5.07229},{"latitude":52.67399,"longitude":5.06906},{"latitude":52.7202,"longitude":5.02538},{"latitude":52.63563,"longitude":4.9565},{"latitude":52.54702,"longitude":4.87765},{"latitude":52.54899,"longitude":4.86904}]}}
        }
    ],
    "summary": {
        "successfulRequests": 3,
        "totalRequests": 4
    }
}

 

Error response example

Result download endpoint error responses will be always XML.

XML:

<?xml version="1.0" encoding="UTF-8"?>
<batchResponse xmlns="http://api.tomtom.com/batch" formatVersion="0.0.1">
    <error description="Batch not found for provided id."/>
</batchResponse>

Error response fields

Field Description
batchResponse Root element of the batch error response.
formatVersion Version of batch error response format.
error Element describing the error.
description Description string.

 

Synchronous batch endpoint

This endpoint allows submitting a new batch for synchronous processing. It responds with a batch processing result or an HTTP 408 Request timeout error, if processing time is exceeds 60 seconds.

Request

HTTP method and URL

POST https://<baseURL>/routing/<versionNumber>/batch/sync[/<outputFormat>]?key=<APIKEY>

Example

https://api.tomtom.com/routing/1/batch/sync/xml?key=<APIKEY>

HTTP Headers

The table below describes HTTP request headers of particular interest to Batch Routing service clients. Required headers must be used or the call will fail. Optional headers, which are highlighted with [square brackets], may be used. If there is a default value that will be assumed when an optional header is not used, it is shown in the table. The order of request headers is not important.

Header Description Req'd? Values Default Value
Content-Type Specifies the MIME type of the body of the request. Yes
  • application/xml
  • application/json
[Accept-Encoding] Should contain list of encodings acceptable by the client. Usually used to demand a compressed response. No gzip

 

Parameters

The table below describes the parameters that can be used in a request. Required parameters must be used or the call will fail. Optional parameters, which are highlighted with [square brackets], may be used. If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table. The order of request parameters is not important.

Parameter Description Req'd? Type / Values Default Value Max Value
baseURL Base URL for calling the API. Yes api.tomtom.com
versionNumber Service version number. The current value is 1. Yes 1
key Authorization key for access to the API. Yes API Key
[outputFormat] The content type of the response structure. No
  • xml
  • json
xml

 

POST body

The POST body of batch request should contain a set of items which will be used to execute requests to the Routing service.

POST body format

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchRequest>
    <batchItems>
        <batchItem>
            <query>...</query>
        </batchItem>
        ...
        <batchItem>
            <query>...</query>
            <post>...</post>
        </batchItem>
    </batchItems>
</batchRequest>

JSON:

{
  "batchItems": [
    {"query": "..."},
    ....
    {
        "query": "..."
        "post": {...}
    }
  ]
}

POST body fields

Field Description
batchRequest Root element of the request.
batchItems A set of batch items. Maximum number of batch items for synchronous API is 100.
batchItem A single batch item.
query A string used to build a request to the Routing service. It is a partial URL without protocol, base URL, service version or API key parts. The output format (last path element) must match the outputFormat parameter of the batch request. When posting XML to the Batch Routing service the <query> element values must be valid XML (e.g. & character must be replaced by predefined XML entity &amp;). More information in List of XML character entity references.

When posting JSON to the Batch Routing service the query string values must be properly escaped (e.g. " character should be escaped with \). More information is available in RFC7159.

Please note that the callback parameter is not supported by Batch Routing. For detailed descriptions refer to the documentation of Calculate Route and Calculate Reachable Range services.

post Contains data that is passed to Calculate Route or Calculate Reachable Range services using the HTTP POST method. The POST data format must match the Content-Type header of a submitted batch request i.e. it should be in the JSON format when Content-Type is set to "application/json" and should be in the XML format if Content-Type is set to "application/xml".
Please refer to POST Data Parameters section of Calculate Route and Calculate Reachable Range services documentation for detailed descriptions and examples of XML and JSON content for this field.

POST body example

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchRequest>
    <batchItems>
        <batchItem>
            <query>/calculateRoute/52.36006039665441,4.851064682006836:52.36187528311709,4.850560426712036/xml?travelMode=car&amp;routeType=shortest&amp;traffic=true&amp;departAt=now&amp;maxAlternatives=0</query>
        </batchItem>
        <batchItem>
            <query>/calculateRoute/52.36241907934766,4.850034713745116:52.36173769505809,4.852169752120972/xml?travelMode=teleport&amp;routeType=shortest&amp;traffic=true&amp;departAt=now</query>
        </batchItem>
        <batchItem>
            <query>/calculateReachableRange/52.36187528311709,4.850560426712036/xml?fuelBudgetInLiters=20&amp;constantSpeedConsumptionInLitersPerHundredkm=50,6</query>
        </batchItem>
        <batchItem>
            <query>/calculateReachableRange/52.36173769505809,4.852169752120972/xml?timeBudgetInSec=1800</query>
        </batchItem>
    </batchItems>
</batchRequest>

JSON:

{
  "batchItems": [
    {"query": "/calculateRoute/52.36006039665441,4.851064682006836:52.36187528311709,4.850560426712036/json?travelMode=car&routeType=shortest&traffic=true&departAt=now&maxAlternatives=0"},
    {"query": "/calculateRoute/52.36241907934766,4.850034713745116:52.36173769505809,4.852169752120972/json?travelMode=teleport&routeType=shortest&traffic=true&departAt=now"},
    {"query": "/calculateReachableRange/52.36187528311709,4.850560426712036/json?fuelBudgetInLiters=20&constantSpeedConsumptionInLitersPerHundredkm=50,6"},
    {"query": "/calculateReachableRange/52.36173769505809,4.852169752120972/json?timeBudgetInSec=1800"}
  ]
}

 

Response

HTTP Status Codes

Code Meaning and Possible Causes
200 OK: The batch request has completed. Results are streamed to client.
400 Bad Request: Missing required parameters, exceeded maximum number of batch items or parameters didn't pass validation.
403 Forbidden: The API key is missing, inactive, invalid, not entitled to use the Batch Routing API, over QPS or over QPD. Can also occur when using HTTP instead of HTTPS.
404 Not Found: the requested resource could not be found, but it may be available again in the future.
405 Method Not Allowed: the client used an HTTP method other than POST.
408 Request timeout.
414 Requested URI is too long.
500 An error occurred while processing the request. Please try again later.
502 Internal network connectivity issue. Please try again later.
503 Service currently unavailable. Please try again later.
504 Internal network connectivity issue or a request that has taken too long to complete. Please try again later.
596 Service not found. Request contains an incorrect FQDN and/or path.

 

HTTP Headers

The table below lists HTTP response headers of particular interest to the Routing service clients.

Header Description Values
Access-Control-Expose-Headers A comma separated list of HTTP header names that browsers are allowed to access. Content-Length
Access-Control-Allow-Origin A header instructing browsers to allow customer websites to contact the Batch Routing service. *
Content-Encoding The Batch Routing service applies gzip compression to the responses, if it is requested by the client with the Accept-Encoding header. gzip
Content-Type The format of the response as chosen by the client (see the contentType request parameter).
  • application/xml; charset=utf-8
  • application/json; charset=utf-8

 

Successful response structure

Each batch response consists of one or more <batchItem> elements which correspond sequentially with the <batchItem> elements in the request. Each <batchItem> element contains a successful response from the invoked Online Routing API or a status code indicating why the batch item failed.

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchResponse xmlns="http://api.tomtom.com/batch" formatVersion="0.0.1">
    <batchItems>
        <batchItem>
            <statusCode>...</statusCode>
            <response>
                ...
            </response>
        </batchItem>
        ...
        <batchItem>
            <statusCode>...</statusCode>
            <response>
                ...
            </response>
        </batchItem>
    </batchItems>
    <summary>
        <successfulRequests>...</successfulRequests>
        <totalRequests>...</totalRequests>
    </summary>
</batchResponse>

JSON:

{
    "formatVersion": "0.0.1",
    "batchItems": [
        {
            "statusCode": ...,
            "response": {...}
        },
        ...,
        {
            "statusCode": ...,
            "response": {...}
        }
    ],
    "summary": {
        "successfulRequests": ...,
        "totalRequests": ...
    }
}

Successful response fields

Field Description
batchResponse Root element of the batch response.
successfulRequests Number of successful batch item requests.
totalRequests Total number of items in batch request.
batchItems A set of batch items processing results.
batchItem Contains results of processing of a single batch item.
statusCode Status code of a response from the Routing endpoint for given batch item.
response Content of the response from the Routing endpoint for given batch item query. The full response content will be included both in case of success and failure.
If the underlying service's response content type does not match requested content type, then the response will be wrapped to fit the requested content type.
summary Summary of the batch request.

Successful response example

To improve readability of the examples, the copyright and privacy sections inside batch items' response are skipped.

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchResponse xmlns="http://api.tomtom.com/batch" formatVersion="0.0.1">
    <batchItems>
        <batchItem>
            <statusCode>200</statusCode>
            <response>
                <calculateRouteResponse xmlns="http://api.tomtom.com/routing" formatVersion="0.0.12"><copyright>...</copyright><privacy>...</privacy><route><summary><lengthInMeters>223</lengthInMeters><travelTimeInSeconds>66</travelTimeInSeconds><trafficDelayInSeconds>0</trafficDelayInSeconds><departureTime>2016-04-22T13:21:30+02:00</departureTime><arrivalTime>2016-04-22T13:22:36+02:00</arrivalTime></summary><leg><summary><lengthInMeters>223</lengthInMeters><travelTimeInSeconds>66</travelTimeInSeconds><trafficDelayInSeconds>0</trafficDelayInSeconds><departureTime>2016-04-22T13:21:30+02:00</departureTime><arrivalTime>2016-04-22T13:22:36+02:00</arrivalTime></summary><points><point latitude="52.36006" longitude="4.85109"/><point latitude="52.36084" longitude="4.85106"/><point latitude="52.36176" longitude="4.85104"/><point latitude="52.36176" longitude="4.85056"/></points></leg><sections><section><startPointIndex>0</startPointIndex><endPointIndex>3</endPointIndex><travelMode>car</travelMode></section></sections></route></calculateRouteResponse>
            </response>
        </batchItem>
        <batchItem>
            <statusCode>400</statusCode>
            <response>
                <calculateRouteResponse xmlns="http://api.tomtom.com/routing" formatVersion="0.0.12"><copyright>...</copyright><privacy>...</privacy><error description="Invalid travel mode value: [teleport]"/></calculateRouteResponse>
            </response>
        </batchItem>
        <batchItem>
            <statusCode>200</statusCode>
            <response>
                <calculateReachableRangeResponse xmlns="http://api.tomtom.com/routing" formatVersion="0.0.1"><copyright>...</copyright><privacy>...</privacy><reachableRange><center latitude="52.36176" longitude="4.85056"/><boundary><point latitude="52.78716" longitude="4.81318"/><point latitude="52.78983" longitude="4.79019"/><point latitude="52.78346" longitude="4.70485"/><point latitude="52.77541" longitude="4.67377"/><point latitude="52.73947" longitude="4.64530"/><point latitude="52.61481" longitude="4.64891"/><point latitude="52.61362" longitude="4.64887"/><point latitude="52.53855" longitude="4.65841"/><point latitude="52.49834" longitude="4.64125"/><point latitude="52.47165" longitude="4.60932"/><point latitude="52.46203" longitude="4.58628"/><point latitude="52.44705" longitude="4.59327"/><point latitude="52.37132" longitude="4.52544"/><point latitude="52.32164" longitude="4.57722"/><point latitude="52.26437" longitude="4.45996"/><point latitude="52.11393" longitude="4.28383"/><point latitude="51.01315" longitude="2.37788"/><point latitude="51.02757" longitude="2.42521"/><point latitude="50.43132" longitude="2.84907"/><point latitude="50.33847" longitude="2.92668"/><point latitude="50.34035" longitude="3.46896"/><point latitude="50.45216" longitude="3.76045"/><point latitude="50.48706" longitude="4.08585"/><point latitude="50.13129" longitude="4.49675"/><point latitude="50.49117" longitude="4.61820"/><point latitude="50.09545" longitude="5.13195"/><point latitude="50.05438" longitude="5.20811"/><point latitude="50.02166" longitude="5.69731"/><point latitude="50.07049" longitude="5.73492"/><point latitude="50.21669" longitude="6.23432"/><point latitude="50.11697" longitude="6.43576"/><point latitude="50.46513" longitude="6.70010"/><point latitude="50.37483" longitude="7.41121"/><point latitude="50.52358" longitude="7.67539"/><point latitude="50.87047" longitude="7.96531"/><point latitude="51.02269" longitude="7.82893"/><point latitude="51.54443" longitude="8.10810"/><point latitude="52.23340" longitude="9.25347"/><point latitude="52.86505" longitude="8.23947"/><point latitude="52.95622" longitude="8.56608"/><point latitude="53.18553" longitude="8.10646"/><point latitude="53.32431" longitude="6.87906"/><point latitude="53.24864" longitude="6.46143"/><point latitude="53.21977" longitude="5.98597"/><point latitude="53.20076" longitude="5.64319"/><point latitude="53.18381" longitude="5.45848"/><point latitude="53.03505" longitude="5.23428"/><point latitude="52.95193" longitude="5.07620"/><point latitude="52.77310" longitude="4.95600"/><point latitude="52.73059" longitude="4.89175"/></boundary></reachableRange></calculateReachableRangeResponse>
            </response>
        </batchItem>
        <batchItem>
            <statusCode>200</statusCode>
            <response>
                <calculateReachableRangeResponse xmlns="http://api.tomtom.com/routing" formatVersion="0.0.1"><copyright>...</copyright><privacy>...</privacy><reachableRange><center latitude="52.36178" longitude="4.85216"/><boundary><point latitude="52.55238" longitude="4.83100"/><point latitude="52.58994" longitude="4.81431"/><point latitude="52.61593" longitude="4.75696"/><point latitude="52.61907" longitude="4.73098"/><point latitude="52.60065" longitude="4.72924"/><point latitude="52.57070" longitude="4.69273"/><point latitude="52.56251" longitude="4.66643"/><point latitude="52.51827" longitude="4.65113"/><point latitude="52.51005" longitude="4.65357"/><point latitude="52.47165" longitude="4.60932"/><point latitude="52.46203" longitude="4.58628"/><point latitude="52.44705" longitude="4.59327"/><point latitude="52.36490" longitude="4.57865"/><point latitude="52.32644" longitude="4.58989"/><point latitude="52.27725" longitude="4.51188"/><point latitude="52.17816" longitude="4.40562"/><point latitude="52.13246" longitude="4.39854"/><point latitude="52.07782" longitude="4.40456"/><point latitude="52.12844" longitude="4.54478"/><point latitude="52.14059" longitude="4.65627"/><point latitude="52.13539" longitude="4.69158"/><point latitude="52.18747" longitude="4.76277"/><point latitude="52.24121" longitude="4.81595"/><point latitude="52.25268" longitude="4.82480"/><point latitude="52.22580" longitude="4.85207"/><point latitude="52.22231" longitude="4.86311"/><point latitude="52.11528" longitude="4.91272"/><point latitude="52.10137" longitude="4.91745"/><point latitude="52.15657" longitude="4.95490"/><point latitude="52.07171" longitude="5.03885"/><point latitude="52.03613" longitude="5.06388"/><point latitude="52.06045" longitude="5.09947"/><point latitude="52.12534" longitude="5.11099"/><point latitude="52.23269" longitude="5.04984"/><point latitude="52.17824" longitude="5.18006"/><point latitude="52.20486" longitude="5.27330"/><point latitude="52.21371" longitude="5.33380"/><point latitude="52.35807" longitude="5.35599"/><point latitude="52.41557" longitude="5.38758"/><point latitude="52.37996" longitude="4.97327"/><point latitude="52.39278" longitude="4.96466"/><point latitude="52.45905" longitude="5.03088"/><point latitude="52.49351" longitude="5.03124"/><point latitude="52.54294" longitude="5.02473"/><point latitude="52.65326" longitude="5.07318"/><point latitude="52.67429" longitude="5.07021"/><point latitude="52.72101" longitude="5.02531"/><point latitude="52.63597" longitude="4.95650"/><point latitude="52.54702" longitude="4.87765"/><point latitude="52.54899" longitude="4.86904"/></boundary></reachableRange></calculateReachableRangeResponse>
            </response>
        </batchItem>
    </batchItems>
    <summary>
        <successfulRequests>3</successfulRequests>
        <totalRequests>4</totalRequests>
    </summary>
</batchResponse>

JSON:

{
    "formatVersion": "0.0.1",
    "batchItems": [
        {
            "statusCode": 200,
            "response": {"formatVersion":"0.0.12","copyright":"...","privacy":"...","routes":[{"summary":{"lengthInMeters":223,"travelTimeInSeconds":66,"trafficDelayInSeconds":0,"departureTime":"2016-04-22T13:43:25+02:00","arrivalTime":"2016-04-22T13:44:31+02:00"},"legs":[{"summary":{"lengthInMeters":223,"travelTimeInSeconds":66,"trafficDelayInSeconds":0,"departureTime":"2016-04-22T13:43:25+02:00","arrivalTime":"2016-04-22T13:44:31+02:00"},"points":[{"latitude":52.36006,"longitude":4.85109},{"latitude":52.36084,"longitude":4.85106},{"latitude":52.36176,"longitude":4.85104},{"latitude":52.36176,"longitude":4.85056}]}],"sections":[{"startPointIndex":0,"endPointIndex":3,"travelMode":"car"}]}]}
        },
        {
            "statusCode": 400,
            "response": {"formatVersion":"0.0.12","copyright":"...","privacy":"...","error":{"description":"Invalid travel mode value: [teleport]"}}
        },
        {
            "statusCode": 200,
            "response":{"formatVersion":"0.0.1","copyright":"...","privacy":"...","reachableRange":{"center":{"latitude":52.36176,"longitude":4.85056},"boundary":[{"latitude":52.78716,"longitude":4.81318},{"latitude":52.78983,"longitude":4.79019},{"latitude":52.78346,"longitude":4.70485},{"latitude":52.77541,"longitude":4.67377},{"latitude":52.73947,"longitude":4.6453},{"latitude":52.61481,"longitude":4.64891},{"latitude":52.61362,"longitude":4.64887},{"latitude":52.53855,"longitude":4.65841},{"latitude":52.49834,"longitude":4.64125},{"latitude":52.47165,"longitude":4.60932},{"latitude":52.46203,"longitude":4.58628},{"latitude":52.44705,"longitude":4.59327},{"latitude":52.37132,"longitude":4.52544},{"latitude":52.32164,"longitude":4.57722},{"latitude":52.26437,"longitude":4.45996},{"latitude":52.11393,"longitude":4.28383},{"latitude":50.98539,"longitude":2.23052},{"latitude":50.98863,"longitude":2.35777},{"latitude":50.43132,"longitude":2.84907},{"latitude":50.33847,"longitude":2.92668},{"latitude":50.22934,"longitude":3.27133},{"latitude":50.45216,"longitude":3.76045},{"latitude":50.48706,"longitude":4.08585},{"latitude":49.98206,"longitude":4.51402},{"latitude":50.49117,"longitude":4.6182},{"latitude":50.09545,"longitude":5.13195},{"latitude":49.91044,"longitude":5.29447},{"latitude":50.02166,"longitude":5.69731},{"latitude":50.07049,"longitude":5.73492},{"latitude":50.21669,"longitude":6.23432},{"latitude":50.11697,"longitude":6.43576},{"latitude":50.46513,"longitude":6.7001},{"latitude":50.37483,"longitude":7.41121},{"latitude":50.52358,"longitude":7.67539},{"latitude":50.87047,"longitude":7.96531},{"latitude":51.02269,"longitude":7.82893},{"latitude":51.54443,"longitude":8.1081},{"latitude":52.2334,"longitude":9.25347},{"latitude":52.86505,"longitude":8.23947},{"latitude":52.95622,"longitude":8.56608},{"latitude":53.18553,"longitude":8.10646},{"latitude":53.32431,"longitude":6.87906},{"latitude":53.24864,"longitude":6.46143},{"latitude":53.21977,"longitude":5.98597},{"latitude":53.20076,"longitude":5.64319},{"latitude":53.18381,"longitude":5.45848},{"latitude":53.03505,"longitude":5.23428},{"latitude":52.95193,"longitude":5.0762},{"latitude":52.7731,"longitude":4.956},{"latitude":52.73059,"longitude":4.89175}]}}
        },
        {
            "statusCode": 200,
            "response":{"formatVersion":"0.0.1","copyright":"...","privacy":"...","reachableRange":{"center":{"latitude":52.36178,"longitude":4.85216},"boundary":[{"latitude":52.55238,"longitude":4.831},{"latitude":52.58944,"longitude":4.81481},{"latitude":52.61593,"longitude":4.75696},{"latitude":52.61869,"longitude":4.73182},{"latitude":52.60065,"longitude":4.72924},{"latitude":52.5704,"longitude":4.69259},{"latitude":52.56248,"longitude":4.66803},{"latitude":52.51754,"longitude":4.65152},{"latitude":52.51005,"longitude":4.65357},{"latitude":52.47165,"longitude":4.60932},{"latitude":52.46203,"longitude":4.58628},{"latitude":52.44705,"longitude":4.59327},{"latitude":52.40392,"longitude":4.54964},{"latitude":52.34494,"longitude":4.58513},{"latitude":52.27725,"longitude":4.51188},{"latitude":52.17925,"longitude":4.40661},{"latitude":52.13387,"longitude":4.40049},{"latitude":52.08084,"longitude":4.4085},{"latitude":52.12844,"longitude":4.54478},{"latitude":52.14113,"longitude":4.6569},{"latitude":52.13626,"longitude":4.69284},{"latitude":52.18881,"longitude":4.76185},{"latitude":52.24121,"longitude":4.81595},{"latitude":52.25268,"longitude":4.8248},{"latitude":52.2258,"longitude":4.85207},{"latitude":52.22231,"longitude":4.86311},{"latitude":52.11528,"longitude":4.91272},{"latitude":52.10203,"longitude":4.91813},{"latitude":52.15657,"longitude":4.9549},{"latitude":52.07171,"longitude":5.03885},{"latitude":52.03868,"longitude":5.06395},{"latitude":52.06083,"longitude":5.09541},{"latitude":52.12659,"longitude":5.1081},{"latitude":52.23269,"longitude":5.04984},{"latitude":52.17824,"longitude":5.18006},{"latitude":52.20553,"longitude":5.27285},{"latitude":52.21432,"longitude":5.33036},{"latitude":52.35769,"longitude":5.3551},{"latitude":52.4155,"longitude":5.38742},{"latitude":52.37996,"longitude":4.97327},{"latitude":52.39278,"longitude":4.96466},{"latitude":52.45905,"longitude":5.03088},{"latitude":52.49351,"longitude":5.03124},{"latitude":52.54294,"longitude":5.02473},{"latitude":52.65356,"longitude":5.07229},{"latitude":52.67399,"longitude":5.06906},{"latitude":52.7202,"longitude":5.02538},{"latitude":52.63563,"longitude":4.9565},{"latitude":52.54702,"longitude":4.87765},{"latitude":52.54899,"longitude":4.86904}]}}
        }
    ],
    "summary": {
        "successfulRequests": 3,
        "totalRequests": 4
    }
}

 

Error response example

The error responses content type depends on the outputFormat parameter.

XML:

<?xml version="1.0" encoding="utf-8"?>
<batchResponse xmlns="http://api.tomtom.com/batch" formatVersion="0.0.1">
    <error description="Output format: csv is unsupported."/>
</batchResponse>

JSON:

{
  "formatVersion": "0.0.1",
  "error": {
    "description": "Output format: csv is unsupported."
  }
}

Error response fields

Field Description
batchResponse Root element of the batch error response.
formatVersion Version of batch error response format.
error Element describing the error.
description Description string.