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.

Examples:

To request routes for legs only:
&routeattributes=none,legs
To add shape and notes to the response, in addition to the default list:
&routeattributes=shape,notes
Optionally, you can also use the abbreviated forms:
&routeattributes=sh,no
To remove legs from the default list:
&routeattributes=-legs
To add notes to the previous example, thus returning waypoints, summary and notes, you can use:
&routeattributes=-legs,notes
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:
&routeattributes=all,-legs

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