Traffic - Get Traffic Incident Detail

Traffic Incident Detail

Applies to: S0 and S1 pricing tiers.

This API provides information on traffic incidents inside a given bounding box, based on the current Traffic Model ID. The Traffic Model ID is available to grant synchronization of data between calls and API's. The Traffic Model ID is a key value for determining the currency of traffic incidents. It is updated every minute, and is valid for two minutes before it times out. It is used in rendering incident tiles. It can be obtained from the Viewport API.

GET https://atlas.microsoft.com/traffic/incident/detail/{format}?api-version=1.0&style={style}&boundingbox={boundingbox}&boundingZoom={boundingZoom}&trafficmodelid={trafficmodelid}
GET https://atlas.microsoft.com/traffic/incident/detail/{format}?subscription-key={subscription-key}&api-version=1.0&style={style}&boundingbox={boundingbox}&boundingZoom={boundingZoom}&trafficmodelid={trafficmodelid}&language={language}&projection={projection}&geometries={geometries}&expandCluster={expandCluster}&originalPosition={originalPosition}

URI Parameters

Name In Required Type Description
format
path True

Desired format of the response. Value can be either json or xml.

subscription-key
query
  • string

One of the Azure Maps keys provided from an Azure Map Account. Refer to the subscription-key security definition.

api-version
query True
  • string

Version number of Azure Maps API. Current version is 1.0

style
query True

The style that will be used to render the tile in Traffic Incident Tile API. This will have an effect on the coordinates of traffic incidents in the reply.

boundingbox
query True
  • string

The boundingbox is represented by two value pairs describing it's corners (first pair for lower left corner and second for upper right). The pairs can either be specified using any of the projection's specified below (e.g., minY,minX,maxY,maxX) or by two latitude-longitude pairs (e.g., minLat,minLon,maxLat,maxLon).

NOTE: If latitude/longitude pairs are used, then the projection parameter must be set to "EPSG4326".

boundingZoom
query True
  • integer

Zoom level for desired tile. 0 to 22 for raster tiles, 0 through 22 for vector tiles

trafficmodelid
query True
  • string

Number referencing traffic model. This can be obtained from the Viewport API. It is updated every minute, and is valid for two minutes before it times out. If the wrong Traffic Model ID is specified, the correct one will be returned by the interface. A value of -1 will always invoke the most recent traffic model

language
query
  • string

ISO 639-1 code for the output language. Supported languages are ar, ca, cs, da, de, el, en, en-GB, en-US, es, et, fi, fr, he, hu, id, in*, it, lt, lv, nb, nl, no, pl, pt, ro, ru, sk, sv, th, tr, zh

projection
query
  • string

The projection used to specify the coordinates in the request and response. EPSG900913 (default) or EPSG4326

geometries
query

The type of vector geometry added to incidents (returned in the element of the response).

expandCluster
query
  • boolean

Boolean to indicate whether to list all traffic incidents in a cluster separately

originalPosition
query
  • boolean

Boolean on whether to return the original position of the incident () as well as the one shifted to the beginning of the traffic tube (

)

Request Header

Name Required Type Description
x-ms-client-id
  • string

Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following articles for guidance.

Responses

Name Type Description
200 OK

OK

Media Types: "application/json", "application/xml"

400 Bad Request

Bad request: one or more parameters were incorrectly specified or are mutually exclusive.

Media Types: "application/json", "application/xml"

401 Unauthorized

Access denied due to invalid subscription key or invalid Azure Active Directory bearer token. Make sure to provide a valid key for an active Azure subscription and Maps resource. Otherwise, verify the WWW-Authenticate header for error code and description of the provided AAD bearer token.

Media Types: "application/json", "application/xml"

Headers

  • WWW-Authenticate: string
403 Forbidden

Permission, capacity, or authentication issues.

Media Types: "application/json", "application/xml"

404 Not Found

Not Found: the requested resource could not be found, but it may be available again in the future.

Media Types: "application/json", "application/xml"

500 Internal Server Error

An error occurred while processing the request. Please try again later.

Media Types: "application/json", "application/xml"

Security

azure_auth

These are the Azure Active Directory OAuth2 Flows. When paired with Azure Role Based Access control it can be used to control access to Azure Maps REST APIs. Azure Role based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built in role or a custom role composed of one or more permissions to Azure Maps REST APIs.

To implement scenarios we recommend viewing authentication concepts. In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.

Note

  • This security definition requires the use of the x-ms-client-id header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API.
  • The Authorization URL is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Azure Active directory configurations.
  • The Azure role based access control is configured from the Azure management plane via Azure portal, Powershell, CLI, Azure SDKs, or REST APIs.
  • Usage of the Azure Maps Web SDK allows for configuration based setup of an application for multiple use cases.
  • Currently Azure Active Directory v1.0 tokens are supported.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

subscription-key

This is a shared key which is provisioned when creating an Azure Maps resource through the Azure management plane via Azure portal, Powershell, CLI, Azure SDKs, or REST APIs. With this key, any application is authorized to access all REST APIs. In other words, these can currently be treated as master keys to the account which they are issued for. For publicly exposed applications our recommendation is to use server to server access of Azure Maps REST APIs where this key can be securely stored.

Type: apiKey
In: query

Examples

GetTrafficIncidentDetail

Sample Request

GET https://atlas.microsoft.com/traffic/incident/detail/json?subscription-key=[subscription-key]&api-version=1.0&style=s3&boundingbox=6841263.950712,511972.674418,6886056.049288,582676.925582&boundingZoom=11&trafficmodelid=1335294634919

Sample Response

{
  "tm": {
    "@id": "1521671948910",
    "poi": [
      {
        "id": "europe_HD_NL_TTR116377227776064",
        "p": {
          "x": 538636.9,
          "y": 6842004.5
        },
        "ic": 9,
        "ty": 1,
        "cs": 0,
        "d": "roadworks",
        "c": "new roadworks layout",
        "f": "Amstelveen/Vinkeveen - N201 (N196)",
        "t": "Uithoorn-Centrum (N196)",
        "l": 220,
        "dl": 14,
        "r": "N196"
      },
      {
        "id": "europe_CLUSTER_11_-34959639",
        "p": {
          "x": 528668.6,
          "y": 6848897.9
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 528622.5,
          "y": 6848661.2
        },
        "ctr": {
          "x": 528714.7,
          "y": 6849134.6
        },
        "cs": 2,
        "l": 190
      },
      {
        "id": "europe_CLUSTER_11_-1540737434",
        "p": {
          "x": 518277,
          "y": 6852206.8
        },
        "ic": 9,
        "ty": 1,
        "cbl": {
          "x": 517421.3,
          "y": 6851776.4
        },
        "ctr": {
          "x": 519132.8,
          "y": 6852637.2
        },
        "cs": 2,
        "l": 1620
      },
      {
        "id": "europe_CLUSTER_11_-26712906",
        "p": {
          "x": 529902.2,
          "y": 6855622.4
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 529524.6,
          "y": 6855377.2
        },
        "ctr": {
          "x": 530279.9,
          "y": 6855867.7
        },
        "cs": 4,
        "l": 660
      },
      {
        "id": "europe_HD_NL_TTR116367997504816",
        "p": {
          "x": 568216,
          "y": 6851287.6
        },
        "ic": 9,
        "ty": 1,
        "cs": 0,
        "d": "roadworks",
        "c": "new roadworks layout",
        "f": "Ankeveen (N236)",
        "t": "Weesp (N236)",
        "l": 2760,
        "dl": 73,
        "r": "N236"
      },
      {
        "id": "europe_HD_NL_TTR116367997261488",
        "p": {
          "x": 561973.7,
          "y": 6854259.4
        },
        "ic": 9,
        "ty": 3,
        "cs": 0,
        "d": "roadworks",
        "c": "new roadworks layout",
        "f": "Weesp (N236)",
        "t": "Ankeveen (N236)",
        "l": 2650,
        "r": "N236"
      },
      {
        "id": "europe_HD_NL_TTR116331064819392",
        "p": {
          "x": 571268.5,
          "y": 6858435.4
        },
        "ic": 8,
        "ty": 4,
        "cs": 0,
        "d": "closed",
        "f": "IJsselmeerweg",
        "t": "A6",
        "l": 370
      },
      {
        "id": "europe_CLUSTER_11_-1442937814",
        "p": {
          "x": 563934,
          "y": 6859271.3
        },
        "ic": 9,
        "ty": 1,
        "cbl": {
          "x": 563726.1,
          "y": 6859250.4
        },
        "ctr": {
          "x": 564141.9,
          "y": 6859292.2
        },
        "cs": 2,
        "l": 460
      },
      {
        "id": "europe_CLUSTER_11_258400781",
        "p": {
          "x": 558055.6,
          "y": 6861147.1
        },
        "ic": 13,
        "ty": 1,
        "cbl": {
          "x": 557493.3,
          "y": 6860514.8
        },
        "ctr": {
          "x": 558618,
          "y": 6861779.4
        },
        "cs": 3,
        "l": 1030
      },
      {
        "id": "europe_HD_NL_TTR116100227865681",
        "p": {
          "x": 542665,
          "y": 6861959.7
        },
        "ic": 8,
        "ty": 4,
        "cs": 0,
        "d": "closed",
        "f": "Strawinskylaan",
        "t": "Matthijs Vermeulenpad",
        "l": 110
      },
      {
        "id": "europe_CLUSTER_11_1438243625",
        "p": {
          "x": 545058.7,
          "y": 6864571.6
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 543779.5,
          "y": 6864070.7
        },
        "ctr": {
          "x": 546337.8,
          "y": 6865072.6
        },
        "cs": 5,
        "l": 1590
      },
      {
        "id": "europe_HD_NL_TTR116081762316976",
        "p": {
          "x": 547507.8,
          "y": 6866259.3
        },
        "ic": 8,
        "ty": 4,
        "cs": 0,
        "d": "closed",
        "f": "Alexanderplein (s113)",
        "t": "Stadhouderskade",
        "l": 390,
        "r": "S100"
      },
      {
        "id": "europe_CLUSTER_11_691732516",
        "p": {
          "x": 541448.7,
          "y": 6867162.1
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 541160.1,
          "y": 6866710.7
        },
        "ctr": {
          "x": 541737.2,
          "y": 6867613.5
        },
        "cs": 4,
        "l": 430
      },
      {
        "id": "europe_CLUSTER_11_1582351486",
        "p": {
          "x": 534709.6,
          "y": 6865174.7
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 534562.2,
          "y": 6865025.3
        },
        "ctr": {
          "x": 534856.9,
          "y": 6865324.2
        },
        "cs": 2,
        "l": 380
      },
      {
        "id": "europe_CLUSTER_11_-2070222267",
        "p": {
          "x": 536813.1,
          "y": 6868188.3
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 536191.1,
          "y": 6867699.7
        },
        "ctr": {
          "x": 537435.1,
          "y": 6868677
        },
        "cs": 7,
        "l": 1380
      },
      {
        "id": "europe_CLUSTER_11_-496866890",
        "p": {
          "x": 516025.5,
          "y": 6871606.3
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 514115.1,
          "y": 6870216.9
        },
        "ctr": {
          "x": 517935.9,
          "y": 6872995.7
        },
        "cs": 7,
        "l": 1510
      },
      {
        "id": "europe_HD_NL_TTR115675492352160",
        "p": {
          "x": 517835.3,
          "y": 6883216.3
        },
        "ic": 8,
        "ty": 4,
        "cs": 0,
        "d": "closed",
        "f": "Amsterdamseweg",
        "t": "A22",
        "l": 710
      },
      {
        "id": "europe_CLUSTER_11_834920993",
        "p": {
          "x": 543803.8,
          "y": 6875659.8
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 543474.7,
          "y": 6875602.7
        },
        "ctr": {
          "x": 544133,
          "y": 6875716.9
        },
        "cs": 2,
        "l": 760
      }
    ]
  }
}
{
  "error": {
    "code": "400 BadRequest",
    "message": "Bad request: one or more parameters were incorrectly specified or are mutually exclusive."
  }
}
{
  "error": {
    "code": "401 Unauthorized",
    "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
  }
}
{
  "error": {
    "code": "403 Forbidden",
    "message": "Permission, capacity, or authentication issues."
  }
}
{
  "error": {
    "code": "404 NotFound",
    "message": "Not Found: the requested resource could not be found, but it may be available again in the future."
  }
}
{
  "error": {
    "code": "500 InternalServerError",
    "message": "An error occurred while processing the request. Please try again later."
  }
}

Definitions

Cbl

Bottom left coordinate of the cluster in the projection of the request

Ctr

Top right coordinate of the cluster in the projection of the request

Error

This object is returned when an error occurs in the Maps API

ErrorResponse

This response object is returned when an error occurs in the Maps API

IncidentGeometryType

The type of vector geometry added to incidents (returned in the element of the response).

P

The point where an icon of the cluster or raw incident should be drawn, expressed in the requested projection. This is affected by traffic style, zoom level and road type

TextFormat

Desired format of the response. Value can be either json or xml.

Tm

Main response element

TrafficIncidentDetailResult

This object is returned from a successful Traffic incident Detail call

TrafficIncidentDetailStyle

The style that will be used to render the tile in Traffic Incident Tile API. This will have an effect on the coordinates of traffic incidents in the reply.

TrafficIncidentPoi

Cbl

Bottom left coordinate of the cluster in the projection of the request

Name Type Description
x
  • number

x coordinate

y
  • number

y coordinate

Ctr

Top right coordinate of the cluster in the projection of the request

Name Type Description
x
  • number

x coordinate

y
  • number

y coordinate

Error

This object is returned when an error occurs in the Maps API

Name Type Description
code
  • string

The HTTP status code.

message
  • string

If available, a human readable description of the error.

ErrorResponse

This response object is returned when an error occurs in the Maps API

Name Type Description
error

This object is returned when an error occurs in the Maps API

IncidentGeometryType

The type of vector geometry added to incidents (returned in the element of the response).

Name Type Description
original
  • string

Places incidents precisely on the road.

shifted
  • string

Moves the incident slightly (depending on zoom level) to indicate specific road lanes.

P

The point where an icon of the cluster or raw incident should be drawn, expressed in the requested projection. This is affected by traffic style, zoom level and road type

Name Type Description
x
  • number

x coordinate

y
  • number

y coordinate

TextFormat

Desired format of the response. Value can be either json or xml.

Name Type Description
json
  • string

The JavaScript Object Notation Data Interchange Format

xml
  • string

The Extensible Markup Language

Tm

Main response element

Name Type Description
@id
  • string

ID of the traffic incident

poi

A single traffic incident, or a cluster of traffic incidents

TrafficIncidentDetailResult

This object is returned from a successful Traffic incident Detail call

Name Type Description
tm

Main response element

TrafficIncidentDetailStyle

The style that will be used to render the tile in Traffic Incident Tile API. This will have an effect on the coordinates of traffic incidents in the reply.

Name Type Description
night
  • string

Night style.

s1
  • string

Creates traffic lines with colored chevrons indicating severity.

s2
  • string

Creates plain lines with certain degree of glow.

s3
  • string

Creates plain lines with certain degree of glow.

TrafficIncidentPoi

Name Type Description
c
  • string

Cause of the incident, where available, in the language requested

cbl

Bottom left coordinate of the cluster in the projection of the request

cs
  • integer

Cluster size: the number of incidents in the cluster

ctr

Top right coordinate of the cluster in the projection of the request

d
  • string

Description of the incident in the language requested

dl
  • integer

Delay caused by the incident in seconds (except in road closures)

f
  • string

From: the name of the intersection or location where the traffic due to the incident starts

ic
  • integer

The icon category associated with this incident. Values are numbers in the range 0-13, with the following meanings -- 0: Unknown, 1: Accident, 2: Fog, 3: Dangerous Conditions, 4: Rain, 5: Ice, 6: Jam, 7: Lane Closed, 8: Road Closed, 9: Road Works, 10: Wind, 11: Flooding, 12: Detour, 13: Cluster

id
  • string

ID of the traffic incident

l
  • integer

Length of the incident in meters

p

The point where an icon of the cluster or raw incident should be drawn, expressed in the requested projection. This is affected by traffic style, zoom level and road type

r
  • string

The road number(s) affected by the incident. Multiple road numbers will delimited by slashes

t
  • string

To: the name of the intersection or location where the traffic due to the incident ends

ty
  • integer

The magnitude of delay associated with incident. These values correspond to incident colors in the traffic tiles