How to get weather alerts along a route
This section provides an example of a request to get actual weather warnings along given route.
Note
Each request is authenticated and requires a valid bearer token to be included in HTTP Authorization header. For more information about obtaining credentials, see the Identity and Access Management Developer Guide.
Request
The code block below demonstrates the complete request.
POST /weather/2.0/alerts HTTP/1.1
Host: weather.cc.api.here.com
Authorization: Bearer eyJhbGceOyJSAMPLEiIsImN0eSISAMPLEt7VTFIllwIM0cKNCjN2WCCTqlwEEmk-t3gx1BpqUFoeBSAMPLEvhj8nl-RBGcyoljY...
Cache-Control: no-cache
Accept: application/json
Content-Type: application/json
{
"route":"52.5160,13.3771;52.5111,13.3712;52.5355,13.3634",
"width":2000
}Response
In case of a successfull request the HTTP status code is 200 and the payload of the response contains an all weather alerts that affects the specified route.
Sample response on the map can looks like this:
The route polygon and all alerts that intersects route are displayed.
Updated 7 days ago