Request incident by ID
You can request detailed information about a single incident by providing the incident's original ID and the type of location referencing to return (locationReferencing
).
The originalId
can be prefixed with a namespace. If no namespace is specified, the default namespace is here:traffic:incident
.
The locationReferencing
can be one or several out of tmc
, olr
, shape
. Specify only the location types that you are able to interpret to ensure that you don't get any data that you can't process.
Note
Specify none
if you are not interested in the location of the incident information. The response will not contain any location references.
For more information on the location referencing types, see Location referencing.
The returned data will be a single incident item that has a location
and an incidentDetails
element. Each location
has a length
in meters and the available location references of the location, that depend on the references requested by the locationReferencing
parameter.
The incidentDetails
element of the incident item carries details such as start-time and end-time, AlertC code, and description of the incident.
curl -H "Authorization: Bearer $TOKEN" "https://data.traffic.hereapi.com/v7/incidents/here:traffic:incident:3879526487457467809?locationReferencing=tmc,shape,olr"
curl "https://data.traffic.hereapi.com/v7/incidents/here:traffic:incident:3879526487457467809?locationReferencing=tmc,shape,olr&apiKey=$API_KEY"
{
"location": {
"length": 376.0,
"tmc": {
"extendedCountryCode": "E0",
"ebuCountryCode": "D",
"tableId": "1",
"locationId": "38219",
"queuingDirection": "-",
"extent": 1,
"primaryOffset": 0.0,
"affectedLength": 367.0
},
"shape": {
"links": [
{
"points": [
{
"lat": 53.90607001259923,
"lng": 13.0477100238204
},
{
"lat": 53.90607001259923,
"lng": 13.047900041565299
}
],
"length": 13.0
},
{
"points": [
{
"lat": 53.90607001259923,
"lng": 13.047900041565299
},
{
"lat": 53.906060038134456,
"lng": 13.048100033774972
},
{
"lat": 53.90604997985065,
"lng": 13.048319974914193
}
],
"length": 28.0
},
...
]
}
},
"incidentDetails": {
"id": "3879526487457467809",
"originalId": "3879526487457467809",
"startTime": "2020-12-30T06:00:00Z",
"endTime": "2021-10-31T15:00:00Z",
"entryTime": "2021-06-11T12:15:20Z",
"roadClosed": true,
"criticality": "critical",
"type": "construction",
"codes": [
1527
],
"description":{
"value":"Veranstaltung; Straße gesperrt."
},
"summary":{
"value":"Veranstaltung; Straße gesperrt."
}
}
}
The response above has been truncated for readability.
The language used by description
and summary
is the original language of the country that the incident belongs to. To get the information in a different language, use the lang
parameter, for example, lang=en-US
for the US English language.
If the incident ID is not found, a "404 NOT FOUND" error is returned.