Customizing the Response
The response to a successful request always contains a default set of elements. However, the service offers flexibility in this respect, allowing you to fine-tune the response by elminating information you do not require or adding information that is not among the default elements. You can manage the information in the response through attribute switch parameters:
For example, to add matchCode
and parsedRequest
, add the following to the request:
&responseattributes=matchCode,parsedRequest
You can also use abbreviated names of the response elements:
&responseattributes=mc,pr
The following example removes mapView
so that the response contains only address
and mapReference
:
&locationattributes=-mapView
To add additionalData
to the previous example and to ensure that the response contains address
, mapReference
and additionalData
, use:
&locationattributes=-mapView,additionalData
If all attributes except mapView
are required, use the value all
and remove unnecessary attributes. The following example causes the whole attribute set except mapView
to be included in the response:
&locationattributes=all,-mapView
none
followed by the required attributes. The following example shows how ensure that address
is the only location attribute in the response. &locationattributes=none,address
The table below documents the supported attribute switch parameters and their values. (This information is also available under Geocode Resource.)
Attribute switch | Values |
---|---|
addressattributes | A comma-separated list whose elements are present in the response data. Enumeration [ Abbreviated forms: [ Default in response: All except Note: The value names are case-sensitive. |
locationattributes | A comma-separated list whose elements are present in the response data. Enumeration [ Abbreviated forms: [ The For retrieving Time Zone information the parameter In reverse geocoding results, The Default in reverse geocoding response: Default in forward geocoding response: With Note: The value names are case-sensitive. |
responseattributes | A comma-separated list whose elements are present in the response data. Enumeration [ Abbreviated forms: [ Default in response: Note: he value names are case-sensitive. |