Route - Post Route Directions Batch Sync

Use to send a batch of queries to the Get Route Directions API in a single synchronous request.

The Post Route Directions Batch Sync API is an HTTP POST request that sends batches of queries to the Get Route Directions API using a single synchronous request. You can call Route Directions Batch API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to 700 queries and sync API up to 100 queries. To call the Post Route Directions Batch API in a asynchronous request, see Post Route Directions Batch.

Submit Synchronous Batch Request

The Synchronous API is recommended for lightweight batch requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later. The Synchronous API will return a timeout error (a 408 response) if the request takes longer than 60 seconds. The number of batch items is limited to 100 for this API.

POST https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0&subscription-key={subscription-key}

Batch Response Model

The returned data content is similar for async and sync requests. When downloading the results of an async batch request, if the batch has finished processing, the response body contains the batch response. This batch response contains a summary component that indicates the totalRequests that were part of the original batch request and successfulRequestsi.e. queries which were executed successfully. The batch response also includes a batchItems array which contains a response for each and every query in the batch request. The batchItems will contain the results in the exact same order the original queries were sent in the batch request. Each item in batchItems contains statusCode and response fields. Each response in batchItems is of one of the following types:

  • RouteDirections - If the query completed successfully.

  • Error - If the query failed. The response will contain a code and a message in this case.

Here's a sample Batch Response with 1 successful and 1 failed result:

{
    "summary": {
        "successfulRequests": 1,
        "totalRequests": 2
    },
    "batchItems": [
        {
            "statusCode": 200,
            "response": {
                "routes": [
                    {
                        "summary": {
                            "lengthInMeters": 1758,
                            "travelTimeInSeconds": 387,
                            "trafficDelayInSeconds": 0,
                            "departureTime": "2018-07-17T00:49:56+00:00",
                            "arrivalTime": "2018-07-17T00:56:22+00:00"
                        },
                        "legs": [
                            {
                                "summary": {
                                    "lengthInMeters": 1758,
                                    "travelTimeInSeconds": 387,
                                    "trafficDelayInSeconds": 0,
                                    "departureTime": "2018-07-17T00:49:56+00:00",
                                    "arrivalTime": "2018-07-17T00:56:22+00:00"
                                },
                                "points": [
                                    {
                                        "latitude": 47.62094,
                                        "longitude": -122.34892
                                    },
                                    {
                                        "latitude": 47.62094,
                                        "longitude": -122.3485
                                    },
                                    {
                                        "latitude": 47.62095,
                                        "longitude": -122.3476
                                    }
                                ]
                            }
                        ],
                        "sections": [
                            {
                                "startPointIndex": 0,
                                "endPointIndex": 40,
                                "sectionType": "TRAVEL_MODE",
                                "travelMode": "bicycle"
                            }
                        ]
                    }
                ]
            }
        },
        {
            "statusCode": 400,
            "response":
            {
                "error":
                {
                    "code": "400 BadRequest",
                    "message": "Bad request: one or more parameters were incorrectly specified or are mutually exclusive."
                }
            }
        }
    ]
}
POST https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0

URI Parameters

Name In Required Type Description
format
path True

JsonFormat

Desired format of the response. Only json format is supported.

api-version
query True

string

Version number of Azure Maps API.

Request Header

Name Required Type Description
x-ms-client-id

string

Specifies which account is intended for usage in conjunction with the Microsoft Entra ID security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Microsoft Entra ID security in Azure Maps see the following articles for guidance.

Request Body

Name Type Description
batchItems

BatchRequestItem[]

The list of queries to process.

Responses

Name Type Description
200 OK

RouteDirectionsBatchResult

OK

Other Status Codes

ErrorResponse

Timeout: The request took longer to finish than the maximum amount of time defined in the api.

Other Status Codes

ErrorResponse

An unexpected error occurred.

Security

AADToken

These are the Microsoft Entra OAuth 2.0 Flows. When paired with Azure role-based access control it can be used to control access to Azure Maps REST APIs. Azure role-based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built-in role or a custom role composed of one or more permissions to Azure Maps REST APIs.

To implement scenarios, we recommend viewing authentication concepts. In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.

Notes

  • This security definition requires the use of the x-ms-client-id header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API.

The Authorization URL is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Microsoft Entra ID configurations. * The Azure role-based access control is configured from the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs. * Usage of the Azure Maps Web SDK allows for configuration based setup of an application for multiple use cases.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
https://atlas.microsoft.com/.default https://atlas.microsoft.com/.default

subscription-key

This is a shared key that is provisioned when you Create an Azure Maps account in the Azure portal or using PowerShell, CLI, Azure SDKs, or REST API.

With this key, any application can access all REST API. In other words, this key can be used as a master key in the account that they are issued in.

For publicly exposed applications, our recommendation is to use the confidential client applications approach to access Azure Maps REST APIs so your key can be securely stored.

Type: apiKey
In: query

SAS Token

This is a shared access signature token is created from the List SAS operation on the Azure Maps resource through the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.

With this token, any application is authorized to access with Azure role-based access controls and fine-grain control to the expiration, rate, and region(s) of use for the particular token. In other words, the SAS Token can be used to allow applications to control access in a more secured way than the shared key.

For publicly exposed applications, our recommendation is to configure a specific list of allowed origins on the Map account resource to limit rendering abuse and regularly renew the SAS Token.

Type: apiKey
In: header

Examples

Successfully retrieve the route direction batch result synchronously

Sample request

POST https://atlas.microsoft.com/route/directions/batch/sync/json?api-version=1.0

{
  "batchItems": [
    {
      "query": "?query=47.639987,-122.128384:47.621252,-122.184408:47.596437,-122.332000&routeType=fastest&travelMode=car&maxAlternatives=99"
    },
    {
      "query": "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false"
    },
    {
      "query": "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest"
    }
  ]
}

Sample response

{
  "batchItems": [
    {
      "statusCode": 400,
      "response": {
        "error": {
          "code": "400 BadRequest",
          "message": "maxAlternatives parameter value should be between 0 and 5 inclusive"
        }
      }
    },
    {
      "statusCode": 200,
      "response": {
        "formatVersion": "0.0.12",
        "routes": [
          {
            "summary": {
              "lengthInMeters": 1754,
              "travelTimeInSeconds": 386,
              "trafficDelayInSeconds": 0,
              "departureTime": "2019-06-21T22:56:23+00:00",
              "arrivalTime": "2019-06-21T23:02:49+00:00"
            },
            "legs": [
              {
                "summary": {
                  "lengthInMeters": 1754,
                  "travelTimeInSeconds": 386,
                  "trafficDelayInSeconds": 0,
                  "departureTime": "2019-06-21T22:56:23+00:00",
                  "arrivalTime": "2019-06-21T23:02:49+00:00"
                },
                "points": [
                  {
                    "latitude": 47.62094,
                    "longitude": -122.34892
                  },
                  {
                    "latitude": 47.62094,
                    "longitude": -122.3485
                  },
                  {
                    "latitude": 47.62095,
                    "longitude": -122.3476
                  },
                  {
                    "latitude": 47.60995,
                    "longitude": -122.34174
                  },
                  {
                    "latitude": 47.61011,
                    "longitude": -122.342
                  }
                ]
              }
            ],
            "sections": [
              {
                "startPointIndex": 0,
                "endPointIndex": 44,
                "sectionType": "TRAVEL_MODE",
                "travelMode": "bicycle"
              }
            ]
          }
        ]
      }
    },
    {
      "statusCode": 200,
      "response": {
        "formatVersion": "0.0.12",
        "routes": [
          {
            "summary": {
              "lengthInMeters": 1772,
              "travelTimeInSeconds": 1276,
              "trafficDelayInSeconds": 0,
              "departureTime": "2019-06-21T22:56:23+00:00",
              "arrivalTime": "2019-06-21T23:17:38+00:00"
            },
            "legs": [
              {
                "summary": {
                  "lengthInMeters": 1772,
                  "travelTimeInSeconds": 1276,
                  "trafficDelayInSeconds": 0,
                  "departureTime": "2019-06-21T22:56:23+00:00",
                  "arrivalTime": "2019-06-21T23:17:38+00:00"
                },
                "points": [
                  {
                    "latitude": 40.75982,
                    "longitude": -73.98493
                  },
                  {
                    "latitude": 40.7601,
                    "longitude": -73.98483
                  },
                  {
                    "latitude": 40.75984,
                    "longitude": -73.98417
                  },
                  {
                    "latitude": 40.76047,
                    "longitude": -73.9837
                  },
                  {
                    "latitude": 40.77095,
                    "longitude": -73.9736
                  },
                  {
                    "latitude": 40.77114,
                    "longitude": -73.97356
                  }
                ]
              }
            ],
            "sections": [
              {
                "startPointIndex": 0,
                "endPointIndex": 47,
                "sectionType": "TRAVEL_MODE",
                "travelMode": "pedestrian"
              }
            ]
          }
        ]
      }
    }
  ],
  "summary": {
    "successfulRequests": 2,
    "totalRequests": 3
  }
}
{
  "error": {
    "code": "408 Timeout",
    "message": "Timeout: The request took longer to finish than the maximum amount of time defined in the api."
  }
}

Definitions

Name Description
BatchRequest

This type represents the request body for the Batch service.

BatchRequestItem

Batch request object

DelayMagnitude

The magnitude of delay caused by the incident. These values correspond to the values of the response field ty of the Get Traffic Incident Detail API.

DrivingSide

Indicates left-hand vs. right-hand side driving at the point of the maneuver.

EffectiveSetting

Effective parameter or data used when calling this Route API.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

GuidanceInstructionType

Type of the instruction, e.g., turn or change of road form.

GuidanceManeuver

A code identifying the maneuver.

JsonFormat

Desired format of the response. Only json format is supported.

JunctionType

The type of the junction where the maneuver takes place. For larger roundabouts, two separate instructions are generated for entering and leaving the roundabout.

LatLongPair

A location represented as a latitude and longitude.

Response

The result of the query. RouteDirections if the query completed successfully, ErrorResponse otherwise.

ResponseSectionType

Section types of the reported route response

ResponseTravelMode

Travel mode for the calculated route. The value will be set to other if the requested mode of transport is not possible in this section

Route
RouteDirectionsBatchItem

An item returned from Route Directions Batch service call.

RouteDirectionsBatchResult

This object is returned from a successful Route Directions Batch service call.

RouteGuidance

Contains guidance related elements. This field is present only when guidance was requested and is available.

RouteInstruction

A set of attributes describing a maneuver, e.g. 'Turn right', 'Keep left', 'Take the ferry', 'Take the motorway', 'Arrive'.

RouteInstructionGroup

Groups a sequence of instruction elements which are related to each other. The sequence range is constrained with firstInstructionIndex and lastInstructionIndex. When human-readable text messages are requested for guidance (instructionType=text or tagged), then the instructionGroup has a summary message returned when available.

RouteLeg

A description of a part of a route, comprised of a list of points. Each additional waypoint provided in the request will result in an additional leg in the returned route.

RouteLegSummary

Summary object for route section.

RouteOptimizedWaypoint

Optimized way point object.

RouteReport

Reports the effective settings used in the current call.

RouteSection

Route sections contain additional information about parts of a route. Each section contains at least the elements startPointIndex, endPointIndex, and sectionType.

RouteSectionTec

Details of the traffic event, using definitions in the TPEG2-TEC standard. Can contain effectCode and causes elements.

RouteSectionTecCause

The cause of the traffic event. Can contain mainCauseCode and subCauseCode elements. Can be used to define iconography and descriptions.

RouteSummary

Summary object

SimpleCategory

Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or OTHER. See "tec" for detailed information.

Summary

Summary of the results for the batch request

BatchRequest

This type represents the request body for the Batch service.

Name Type Description
batchItems

BatchRequestItem[]

The list of queries to process.

BatchRequestItem

Batch request object

Name Type Description
query

string

This parameter contains a query string used to perform an unstructured geocoding operation. The query string will be passed verbatim to the search API for processing.

DelayMagnitude

The magnitude of delay caused by the incident. These values correspond to the values of the response field ty of the Get Traffic Incident Detail API.

Name Type Description
0

string

Unknown.

1

string

Minor.

2

string

Moderate.

3

string

Major.

4

string

Undefined, used for road closures and other indefinite delays.

DrivingSide

Indicates left-hand vs. right-hand side driving at the point of the maneuver.

Name Type Description
LEFT

string

Left side.

RIGHT

string

Right side.

EffectiveSetting

Effective parameter or data used when calling this Route API.

Name Type Description
key

string

Name of the parameter used.

value

string

Value of the parameter used.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

GuidanceInstructionType

Type of the instruction, e.g., turn or change of road form.

Name Type Description
DIRECTION_INFO

string

Direction information.

LOCATION_ARRIVAL

string

Arrival location.

LOCATION_DEPARTURE

string

Departure location.

LOCATION_WAYPOINT

string

Way point location.

ROAD_CHANGE

string

Road Change.

TURN

string

Turn.

GuidanceManeuver

A code identifying the maneuver.

Name Type Description
ARRIVE

string

You have arrived.

ARRIVE_LEFT

string

You have arrived. Your destination is on the left.

ARRIVE_RIGHT

string

You have arrived. Your destination is on the right.

BEAR_LEFT

string

Bear left.

BEAR_RIGHT

string

Bear right.

DEPART

string

Leave.

ENTER_FREEWAY

string

Take the freeway.

ENTER_HIGHWAY

string

Take the highway.

ENTER_MOTORWAY

string

Take the motorway.

ENTRANCE_RAMP

string

Take the ramp.

FOLLOW

string

Follow.

KEEP_LEFT

string

Keep left.

KEEP_RIGHT

string

Keep right.

MAKE_UTURN

string

Make a U-turn.

MOTORWAY_EXIT_LEFT

string

Take the left exit.

MOTORWAY_EXIT_RIGHT

string

Take the right exit.

ROUNDABOUT_BACK

string

Go around the roundabout.

ROUNDABOUT_CROSS

string

Cross the roundabout.

ROUNDABOUT_LEFT

string

At the roundabout take the exit on the left.

ROUNDABOUT_RIGHT

string

At the roundabout take the exit on the right.

SHARP_LEFT

string

Turn sharp left.

SHARP_RIGHT

string

Turn sharp right.

STRAIGHT

string

Keep straight on.

SWITCH_MAIN_ROAD

string

Switch to the main road.

SWITCH_PARALLEL_ROAD

string

Switch to the parallel road.

TAKE_EXIT

string

Take the exit.

TAKE_FERRY

string

Take the ferry.

TRY_MAKE_UTURN

string

Try to make a U-turn.

TURN_LEFT

string

Turn left.

TURN_RIGHT

string

Turn right.

WAYPOINT_LEFT

string

You have reached the waypoint. It is on the left.

WAYPOINT_REACHED

string

You have reached the waypoint.

WAYPOINT_RIGHT

string

You have reached the waypoint. It is on the right.

JsonFormat

Desired format of the response. Only json format is supported.

Name Type Description
json

string

The JavaScript Object Notation Data Interchange Format

JunctionType

The type of the junction where the maneuver takes place. For larger roundabouts, two separate instructions are generated for entering and leaving the roundabout.

Name Type Description
BIFURCATION

string

bifurcation

REGULAR

string

regular

ROUNDABOUT

string

roundabout

LatLongPair

A location represented as a latitude and longitude.

Name Type Description
latitude

number

Latitude property

longitude

number

Longitude property

Response

The result of the query. RouteDirections if the query completed successfully, ErrorResponse otherwise.

Name Type Description
error

ErrorDetail

The error object.

formatVersion

string

Format Version property

optimizedWaypoints

RouteOptimizedWaypoint[]

Optimized sequence of waypoints. It shows the index from the user provided waypoint sequence for the original and optimized list. For instance, a response:

<optimizedWaypoints>
<waypoint providedIndex="0" optimizedIndex="1"/>
<waypoint providedIndex="1" optimizedIndex="2"/>
<waypoint providedIndex="2" optimizedIndex="0"/>
</optimizedWaypoints>

means that the original sequence is [0, 1, 2] and optimized sequence is [1, 2, 0]. Since the index starts by 0 the original is "first, second, third" while the optimized is "second, third, first".

report

RouteReport

Reports the effective settings used in the current call.

routes

Route[]

Routes array

ResponseSectionType

Section types of the reported route response

Name Type Description
CARPOOL

string

Sections of the route that require use of carpool (HOV/High Occupancy Vehicle) lanes.

CAR_TRAIN

string

Sections of the route that are cars or trains.

COUNTRY

string

Sections indicating which countries/regions the route is in.

FERRY

string

Sections of the route that are ferries.

MOTORWAY

string

Sections of the route that are motorways.

PEDESTRIAN

string

Sections of the route that are only suited for pedestrians.

TOLL_ROAD

string

Sections of the route that require a toll to be payed.

TOLL_VIGNETTE

string

Sections of the route that require a toll vignette to be present.

TRAFFIC

string

Sections of the route that contain traffic information.

TRAVEL_MODE

string

Sections in relation to the request parameter travelMode.

TUNNEL

string

Sections of the route that are tunnels.

URBAN

string

Sections of the route that are located within urban areas.

ResponseTravelMode

Travel mode for the calculated route. The value will be set to other if the requested mode of transport is not possible in this section

Name Type Description
bicycle

string

The returned routes are optimized for bicycles, including use of bicycle lanes.

bus

string

The returned routes are optimized for buses, including the use of bus only lanes. BETA functionality.

car

string

The returned routes are optimized for cars.

motorcycle

string

The returned routes are optimized for motorcycles. BETA functionality.

other

string

The given mode of transport is not possible in this section

pedestrian

string

The returned routes are optimized for pedestrians, including the use of sidewalks.

taxi

string

The returned routes are optimized for taxis. BETA functionality.

truck

string

The returned routes are optimized for commercial vehicles, like for trucks.

van

string

The returned routes are optimized for vans. BETA functionality.

Route

Name Type Description
guidance

RouteGuidance

Contains guidance related elements. This field is present only when guidance was requested and is available.

legs

RouteLeg[]

Legs array

sections

RouteSection[]

Sections array

summary

RouteSummary

Summary object

RouteDirectionsBatchItem

An item returned from Route Directions Batch service call.

Name Type Description
response

Response

The result of the query. RouteDirections if the query completed successfully, ErrorResponse otherwise.

statusCode

integer

HTTP request status code.

RouteDirectionsBatchResult

This object is returned from a successful Route Directions Batch service call.

Name Type Description
batchItems

RouteDirectionsBatchItem[]

Array containing the batch results.

summary

Summary

Summary of the results for the batch request

RouteGuidance

Contains guidance related elements. This field is present only when guidance was requested and is available.

Name Type Description
instructionGroups

RouteInstructionGroup[]

Groups a sequence of instruction elements which are related to each other.

instructions

RouteInstruction[]

A list of instructions describing maneuvers.

RouteInstruction

A set of attributes describing a maneuver, e.g. 'Turn right', 'Keep left', 'Take the ferry', 'Take the motorway', 'Arrive'.

Name Type Description
combinedMessage

string

A human-readable message for the maneuver combined with the message from the next instruction. Sometimes it is possible to combine two successive instructions into a single instruction making it easier to follow. When this is the case the possibleCombineWithNext flag will be true. For example:

10. Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam
11. Follow Einsteinweg/A10/E22 towards Ring Amsterdam

The possibleCombineWithNext flag on instruction 10 is true. This indicates to the clients of coded guidance that it can be combined with instruction 11. The instructions will be combined automatically for clients requesting human-readable guidance. The combinedMessage field contains the combined message:

Turn left onto Einsteinweg/A10/E22 towards Ring Amsterdam
then follow Einsteinweg/A10/E22 towards Ring Amsterdam.
countryCode

string

3-character ISO 3166-1 alpha-3 country code. E.g. USA.

drivingSide

DrivingSide

Indicates left-hand vs. right-hand side driving at the point of the maneuver.

exitNumber

string

The number(s) of a highway exit taken by the current maneuver. If an exit has multiple exit numbers, they will be separated by "," and possibly aggregated by "-", e.g., "10, 13-15".

instructionType

GuidanceInstructionType

Type of the instruction, e.g., turn or change of road form.

junctionType

JunctionType

The type of the junction where the maneuver takes place. For larger roundabouts, two separate instructions are generated for entering and leaving the roundabout.

maneuver

GuidanceManeuver

A code identifying the maneuver.

message

string

A human-readable message for the maneuver.

point

LatLongPair

A location represented as a latitude and longitude.

pointIndex

integer

The index of the point in the list of polyline "points" corresponding to the point of the instruction.

possibleCombineWithNext

boolean

It is possible to optionally combine the instruction with the next one. This can be used to build messages like "Turn left and then turn right".

roadNumbers

string[]

The road number(s) of the next significant road segment(s) after the maneuver, or of the road(s) to be followed. Example: ["E34", "N205"]

roundaboutExitNumber

integer

This indicates which exit to take at a roundabout.

routeOffsetInMeters

integer

Distance from the start of the route to the point of the instruction.

signpostText

string

The text on a signpost which is most relevant to the maneuver, or to the direction that should be followed.

stateCode

string

A subdivision (e.g., state) of the country, represented by the second part of an ISO 3166-2 code. This is only available for some countries/regions like the US, Canada, and Mexico.

street

string

Street name of the next significant road segment after the maneuver, or of the street that should be followed.

travelTimeInSeconds

integer

Estimated travel time up to the point corresponding to routeOffsetInMeters.

turnAngleInDecimalDegrees

integer

Indicates the direction of an instruction. If junctionType indicates a turn instruction:

  • 180 = U-turn
  • [-179, -1] = Left turn
  • 0 = Straight on (a '0 degree' turn)
  • [1, 179] = Right turn

If junctionType indicates a bifurcation instruction:

  • <0 - keep left
  • >0 - keep right

RouteInstructionGroup

Groups a sequence of instruction elements which are related to each other. The sequence range is constrained with firstInstructionIndex and lastInstructionIndex. When human-readable text messages are requested for guidance (instructionType=text or tagged), then the instructionGroup has a summary message returned when available.

Name Type Description
firstInstructionIndex

integer

Index of the first instruction in the instructions and belonging to this group.

groupLengthInMeters

integer

Length of the group.

groupMessage

string

Summary message when human-readable text messages are requested for guidance (instructionType=text or tagged).

lastInstructionIndex

integer

Index of the last instruction in the instructions and belonging to this group.

RouteLeg

A description of a part of a route, comprised of a list of points. Each additional waypoint provided in the request will result in an additional leg in the returned route.

Name Type Description
points

LatLongPair[]

Points array

summary

RouteLegSummary

Summary object for route section.

RouteLegSummary

Summary object for route section.

Name Type Description
arrivalTime

string

The estimated arrival time for the route or leg. Time is in UTC.

batteryConsumptionInkWh

number

Estimated electric energy consumption in kilowatt hours (kWh) using the Electric Consumption Model. Included if vehicleEngineType is set to electric and constantSpeedConsumptionInkWhPerHundredkm is specified. The value of batteryConsumptionInkWh includes the recuperated electric energy and can therefore be negative (which indicates gaining energy). If both maxChargeInkWh and currentChargeInkWh are specified, recuperation will be capped to ensure that the battery charge level never exceeds maxChargeInkWh. If neither maxChargeInkWh nor currentChargeInkWh are specified, unconstrained recuperation is assumed in the consumption calculation.

departureTime

string

The estimated departure time for the route or leg. Time is in UTC.

fuelConsumptionInLiters

number

Estimated fuel consumption in liters using the Combustion Consumption Model. Included if vehicleEngineType is set to combustion and constantSpeedConsumptionInLitersPerHundredkm is specified. The value will be non-negative.

historicTrafficTravelTimeInSeconds

integer

Estimated travel time calculated using time-dependent historic traffic data. Included only if computeTravelTimeFor = all is used in the query.

lengthInMeters

integer

Length In Meters property

liveTrafficIncidentsTravelTimeInSeconds

integer

Estimated travel time calculated using real-time speed data. Included only if computeTravelTimeFor = all is used in the query.

noTrafficTravelTimeInSeconds

integer

Estimated travel time calculated as if there are no delays on the route due to traffic conditions (e.g. congestion). Included only if computeTravelTimeFor = all is used in the query.

trafficDelayInSeconds

integer

Estimated delay in seconds caused by the real-time incident(s) according to traffic information. For routes planned with departure time in the future, delays is always 0. To return additional travel times using different types of traffic information, parameter computeTravelTimeFor=all needs to be added.

travelTimeInSeconds

integer

Estimated travel time in seconds property that includes the delay due to real-time traffic. Note that even when traffic=false travelTimeInSeconds still includes the delay due to traffic. If DepartAt is in the future, travel time is calculated using time-dependent historic traffic data.

RouteOptimizedWaypoint

Optimized way point object.

Name Type Description
optimizedIndex

integer

Optimized way point index from the system.

providedIndex

integer

Way point index provided by the user.

RouteReport

Reports the effective settings used in the current call.

Name Type Description
effectiveSettings

EffectiveSetting[]

Effective parameters or data used when calling this Route API.

RouteSection

Route sections contain additional information about parts of a route. Each section contains at least the elements startPointIndex, endPointIndex, and sectionType.

Name Type Description
delayInSeconds

integer

Delay in seconds caused by the incident.

effectiveSpeedInKmh

integer

Effective speed of the incident in km/h, averaged over its entire length.

endPointIndex

integer

Index of the last point (offset 0) in the route this section applies to.

magnitudeOfDelay

DelayMagnitude

The magnitude of delay caused by the incident. These values correspond to the values of the response field ty of the Get Traffic Incident Detail API.

sectionType

ResponseSectionType

Section types of the reported route response

simpleCategory

SimpleCategory

Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or OTHER. See "tec" for detailed information.

startPointIndex

integer

Index of the first point (offset 0) in the route this section applies to.

tec

RouteSectionTec

Details of the traffic event, using definitions in the TPEG2-TEC standard. Can contain effectCode and causes elements.

travelMode

ResponseTravelMode

Travel mode for the calculated route. The value will be set to other if the requested mode of transport is not possible in this section

RouteSectionTec

Details of the traffic event, using definitions in the TPEG2-TEC standard. Can contain effectCode and causes elements.

Name Type Description
causes

RouteSectionTecCause[]

Causes array

effectCode

integer

The effect on the traffic flow. Contains a value in the tec001:EffectCode table, as defined in the TPEG2-TEC standard. Can be used to color-code traffic events according to severity.

RouteSectionTecCause

The cause of the traffic event. Can contain mainCauseCode and subCauseCode elements. Can be used to define iconography and descriptions.

Name Type Description
mainCauseCode

integer

The main cause of the traffic event. Contains a value in the tec002:CauseCode table, as defined in the TPEG2-TEC standard.

subCauseCode

integer

The subcause of the traffic event. Contains a value in the sub cause table defined by the mainCauseCode, as defined in the TPEG2-TEC standard.

RouteSummary

Summary object

Name Type Description
arrivalTime

string

The estimated arrival time for the route or leg. Time is in UTC.

departureTime

string

The estimated departure time for the route or leg. Time is in UTC.

lengthInMeters

integer

Length In Meters property

trafficDelayInSeconds

integer

Estimated delay in seconds caused by the real-time incident(s) according to traffic information. For routes planned with departure time in the future, delays is always 0. To return additional travel times using different types of traffic information, parameter computeTravelTimeFor=all needs to be added.

travelTimeInSeconds

integer

Estimated travel time in seconds property that includes the delay due to real-time traffic. Note that even when traffic=false travelTimeInSeconds still includes the delay due to traffic. If DepartAt is in the future, travel time is calculated using time-dependent historic traffic data.

SimpleCategory

Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or OTHER. See "tec" for detailed information.

Name Type Description
JAM

string

Traffic jam.

OTHER

string

Other.

ROAD_CLOSURE

string

Road closure.

ROAD_WORK

string

Road work.

Summary

Summary of the results for the batch request

Name Type Description
successfulRequests

integer

Number of successful requests in the batch

totalRequests

integer

Total number of requests in the batch