JSON Representation
The jsonAttributes
parameter controls the JSON response representation. Combine different values by adding the respective values.
Value | Description |
---|---|
1 | Lower case first character of identifiers, this is default behaviour. |
8 | Include _type element in JSON output for classes with abstract parent classes, this is default behaviour. |
16 | Use plural naming for collections. The default is to use singular naming. |
32 | Flatten list of shape strings to double arrays containing lat/lon pairs. Potentially available altitude values are not returned. By default shapes are returned as lists of strings. |
64 | Flatten list of shape strings to double arrays containing lat/lon/alt triplets. Altitude values are returned if available. By default shapes are returned as lists of strings. |
128 | Suppress JSON response object wrapper. |
For example, to specify JSON output with lowercased identifiers (1), including _type attributes (8) and a double representation of shape points (32) use jsonAttributes=41
:
https://route.ls.hereapi.com/routing/7.2/calculateroute.json
?apiKey={YOUR_API_KEY}
&waypoint0=geo!37.7914050,-122.3987030
&waypoint1=geo!37.7866569,-122.4026513
&jsonAttributes=41
&mode=fastest;car;