Routing API Developer's Guide

Attribute Switches

Attribute switches allow you to select the subset of response data you require for each request. By default, the API returns a list of [waypoints, summary, and legs]. If you use the routeattributes request parameter, you can add or remove elements for particular use cases from this default list.

To save bandwidth and simplify processing, the best practice is to select only the set of attributes you require, by using the none value and adding required attributes.


To request routes for legs only:
To add shape and notes to the response, in addition to the default list:
Optionally, you can also use the abbreviated forms:
To remove legs from the default list:
To add notes to the previous example, thus returning waypoints, summary and notes, you can use:
If all attributes except legs are required, use the all value and then remove the unnecessary attributes. The following code snippet returns the whole attribute set except legs:

For a complete list of attribute switches available in the API, see RouteRepresentationOptionsType.