{ "swagger": "2.0", "info": { "title": "Maps Traffic", "version": "2025-01-01", "description": "Azure Maps Traffic REST APIs", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "{endpoint}", "useSchemePrefix": false, "parameters": [ { "name": "endpoint", "in": "path", "description": "The Azure Maps service hostname. Use `https://atlas.microsoft.com` for the Azure public cloud. To target a specific Azure Maps geography or a sovereign cloud, see [Azure Maps geographic scope](https://learn.microsoft.com/azure/azure-maps/geographic-scope).", "required": true, "type": "string", "format": "uri", "default": "https://atlas.microsoft.com", "x-ms-skip-url-encoding": true } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "AadToken": [ "https://atlas.microsoft.com/.default" ] }, { "SharedKey": [] }, { "SasToken": [] } ], "securityDefinitions": { "AadToken": { "type": "oauth2", "description": "These are the [Microsoft Entra OAuth 2.0](https://docs.microsoft.com/azure/active-directory/develop/v1-overview) Flows. When paired with [Azure role-based access](https://docs.microsoft.com/azure/role-based-access-control/overview) 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.\n\nTo implement scenarios, we recommend viewing [authentication concepts](https://aka.ms/amauth). In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.\n\n> [!NOTE]\n>\n> * 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](https://aka.ms/amauthdetails).\n> * The `Authorization URL` is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Microsoft Entra ID configurations.\n> * The Azure role-based access control is configured from the [Azure management plane](https://aka.ms/amrbac) via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.\n> * Usage of the [Azure Maps Web SDK](https://aka.ms/amaadmc) allows for configuration based setup of an application for multiple use cases.\n> * For more information on Microsoft identity platform, see [Microsoft identity platform overview](https://learn.microsoft.com/entra/identity-platform/v2-overview).", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "https://atlas.microsoft.com/.default": "" } }, "SasToken": { "type": "apiKey", "description": "This is a shared access signature token is created from the List SAS operation on the [Azure Maps resource](https://aka.ms/amauth) through the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.\n\nWith this token, any application is authorized to access with Azure role-based access controls and fine-grain control to the expiration, rate, and region(s) of use for the particular token. In other words, the SAS Token can be used to allow applications to control access in a more secured way than the shared key.\n\nFor publicly exposed applications, our recommendation is to configure a specific list of allowed origins on the [Map account resource](https://aka.ms/amauth) to limit rendering abuse and regularly renew the SAS Token.", "name": "SAS Token", "in": "header" }, "SharedKey": { "type": "apiKey", "description": "This is a shared key that is provisioned when you [Create an Azure Maps account](https://docs.microsoft.com/azure/azure-maps/quick-demo-map-app#create-an-azure-maps-account) in the Azure portal or using PowerShell, CLI, Azure SDKs, or REST API.\n\nWith this key, any application can access all REST API. In other words, this key can be used as a master key in the account that they are issued in.\n\nFor publicly exposed applications, our recommendation is to use the [confidential client applications](https://docs.microsoft.com/azure/azure-maps/authentication-best-practices#confidential-client-applications) approach to access Azure Maps REST APIs so your key can be securely stored.", "name": "subscription-key", "in": "header" } }, "tags": [], "paths": { "/traffic/incident": { "get": { "operationId": "Traffic_GetTrafficIncident", "summary": "The Traffic Incident API provides traffic incidents like construction, traffic\ncongestion and accidents, etc. within a bounding box. It also provides traffic\nmetadata for detailed information about each incident.", "description": "The API provides a GeoJSON feature collection of traffic incidents. Each\nincident includes two point features: the location where you encounter the\nincident and the end location of a traffic incident like the end of a\nconstruction zone. For traffic incident coverage by country/region, see\n[traffic\ncoverage](https://learn.microsoft.com/azure/azure-maps/traffic-coverage?pivots=latest).", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "x-ms-client-id", "in": "header", "description": "Specifies which account is intended for usage in conjunction with the Azure AD\nsecurity model. It represents a unique ID for the Azure Maps account and can\nbe retrieved from the Azure Maps management plane Account API. For more\ninformation on using Microsoft Entra ID security in Azure Maps, see [Manage\nauthentication in Azure Maps](/azure/azure-maps/how-to-manage-authentication).", "required": false, "type": "string", "x-ms-client-name": "clientId" }, { "name": "incidentType", "in": "query", "description": "Specifies the type of traffic incident to be returned. Multiple incident types\nwithin a single request are supported. If not specified, the results will\ninclude all incident types within the provided bounding box.\n\nExample, '&incidentType=Accident' or '&incidentType=Accident,Construction'.", "required": false, "type": "string", "enum": [ "Accident", "Congestion", "DisabledVehicle", "Miscellaneous", "RoadHazard", "Construction", "Weather" ], "x-ms-enum": { "name": "IncidentType", "modelAsString": true, "values": [ { "name": "Accident", "value": "Accident", "description": "Accident" }, { "name": "Congestion", "value": "Congestion", "description": "Congestion" }, { "name": "DisabledVehicle", "value": "DisabledVehicle", "description": "DisabledVehicle" }, { "name": "Miscellaneous", "value": "Miscellaneous", "description": "Miscellaneous" }, { "name": "RoadHazard", "value": "RoadHazard", "description": "RoadHazard" }, { "name": "Construction", "value": "Construction", "description": "Construction" }, { "name": "Weather", "value": "Weather", "description": "Weather" } ] } }, { "name": "bbox", "in": "query", "description": "Defines a rectangular area of interest on the Earth's surface. The sides of the\nrectangle are specified by longitude and latitude values and must adhere to the\nGeoJSON format: [minLon, minLat, maxLon, maxLat]. For more information, see\n[RFC 7946, Section 5](https://www.rfc-editor.org/rfc/rfc7946#section-5).\n**Example**: `bbox=-105,37,-94,45`", "required": true, "type": "array", "items": { "type": "number", "format": "double" }, "collectionFormat": "csv" }, { "name": "Accept-Language", "in": "header", "description": "Language in which traffic incident results should be returned.\n\nFor more information, see [Supported\nLanguages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for\nreference.", "required": false, "type": "string", "x-ms-client-name": "acceptLanguage" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/TrafficIncidentResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Request information about a traffic incident": { "$ref": "./examples/GetTrafficIncident.json" } } } } }, "definitions": { "ErrorAdditionalInfo": { "type": "object", "description": "The resource management error additional info.", "properties": { "type": { "type": "string", "description": "The additional info type.", "readOnly": true }, "info": { "type": "object", "description": "The additional info.", "additionalProperties": { "type": "string" }, "readOnly": true } } }, "ErrorDetail": { "type": "object", "description": "The error detail.", "properties": { "code": { "type": "string", "description": "The error code.", "readOnly": true }, "message": { "type": "string", "description": "The error message.", "readOnly": true }, "target": { "type": "string", "description": "The error target.", "readOnly": true }, "details": { "type": "array", "description": "The error details.", "items": { "$ref": "#/definitions/ErrorDetail" }, "readOnly": true }, "additionalInfo": { "type": "array", "description": "The error additional info.", "items": { "$ref": "#/definitions/ErrorAdditionalInfo" }, "readOnly": true } } }, "ErrorResponse": { "type": "object", "description": "Common error response for all Azure Resource Manager APIs to return error\ndetails for failed operations. (This also follows the OData error response\nformat.).", "properties": { "error": { "$ref": "#/definitions/ErrorDetail", "description": "The error object." } } }, "FeatureTypeEnum": { "type": "string", "description": "Specifies the `GeoJSON` type. The only supported object type is\n`FeatureCollection`. For more information, see [RFC\n7946](https://www.rfc-editor.org/rfc/rfc7946).", "enum": [ "FeatureCollection" ], "x-ms-enum": { "name": "FeatureTypeEnum", "modelAsString": true, "values": [ { "name": "FeatureCollection", "value": "FeatureCollection", "description": "Specifies the `GeoJSON` `FeatureCollection` object type." } ] } }, "FeaturesItemTypeEnum": { "type": "string", "description": "Specifies the `GeoJSON` type. The only supported object type is Feature. For\nmore information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946).", "enum": [ "Feature" ], "x-ms-enum": { "name": "FeaturesItemTypeEnum", "modelAsString": true, "values": [ { "name": "Feature", "value": "Feature", "description": "Specifies the `GeoJSON` Feature object type." } ] } }, "GeoJsonGeometry": { "type": "object", "description": "A valid `GeoJSON` geometry object. The type must be one of the seven valid\nGeoJSON geometry types - Point, MultiPoint, LineString, MultiLineString,\nPolygon, MultiPolygon and GeometryCollection. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1) for details.", "properties": { "type": { "$ref": "#/definitions/GeoJsonObjectType", "description": "Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object\ntypes - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon,\nGeometryCollection, Feature and FeatureCollection." }, "bbox": { "type": "array", "description": "Bounding box. Projection used - EPSG:3857. Please refer to [RFC 7946](https://datatracker.ietf.org/doc/html/rfc7946#section-5) for details.", "minItems": 4, "maxItems": 4, "items": { "type": "number", "format": "double" } } }, "discriminator": "type", "required": [ "type" ] }, "GeoJsonGeometryCollection": { "type": "object", "description": "A valid `GeoJSON GeometryCollection` object type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.8) for details.", "properties": { "geometries": { "type": "array", "description": "Contains a list of valid `GeoJSON` geometry objects. **Note** that coordinates\nin GeoJSON are in x, y order (longitude, latitude).", "items": { "$ref": "#/definitions/GeoJsonGeometry" } } }, "required": [ "geometries" ], "allOf": [ { "$ref": "#/definitions/GeoJsonGeometry" } ], "x-ms-discriminator-value": "GeometryCollection" }, "GeoJsonLineString": { "type": "object", "description": "A valid `GeoJSON LineString` geometry type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.4) for details.", "properties": { "coordinates": { "type": "array", "description": "Coordinates for the `GeoJson LineString` geometry.", "items": { "type": "array", "items": { "type": "number", "format": "double" } } } }, "required": [ "coordinates" ], "allOf": [ { "$ref": "#/definitions/GeoJsonGeometry" } ], "x-ms-discriminator-value": "LineString" }, "GeoJsonMultiLineString": { "type": "object", "description": "A valid `GeoJSON MultiLineString` geometry type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.5) for details.", "properties": { "coordinates": { "type": "array", "description": "Coordinates for the `GeoJson MultiLineString` geometry.", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "double" } } } } }, "required": [ "coordinates" ], "allOf": [ { "$ref": "#/definitions/GeoJsonGeometry" } ], "x-ms-discriminator-value": "MultiLineString" }, "GeoJsonMultiPoint": { "type": "object", "description": "A valid `GeoJSON MultiPoint` geometry type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.3) for details.", "properties": { "coordinates": { "type": "array", "description": "Coordinates for the `GeoJson MultiPoint` geometry.", "items": { "type": "array", "items": { "type": "number", "format": "double" } } } }, "required": [ "coordinates" ], "allOf": [ { "$ref": "#/definitions/GeoJsonGeometry" } ], "x-ms-discriminator-value": "MultiPoint" }, "GeoJsonMultiPolygon": { "type": "object", "description": "A valid `GeoJSON MultiPolygon` object type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.7) for details.", "properties": { "coordinates": { "type": "array", "description": "Contains a list of valid `GeoJSON Polygon` objects. **Note** that coordinates\nin GeoJSON are in x, y order (longitude, latitude).", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "double" } } } } } }, "required": [ "coordinates" ], "allOf": [ { "$ref": "#/definitions/GeoJsonGeometry" } ], "x-ms-discriminator-value": "MultiPolygon" }, "GeoJsonObjectType": { "type": "string", "description": "Specifies the `GeoJSON` type. Must be one of the nine valid GeoJSON object\ntypes - Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon,\nGeometryCollection, Feature and FeatureCollection.", "enum": [ "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", "FeatureCollection" ], "x-ms-enum": { "name": "GeoJsonObjectType", "modelAsString": false, "values": [ { "name": "GeoJsonPoint", "value": "Point", "description": "`GeoJSON Point` geometry." }, { "name": "GeoJsonMultiPoint", "value": "MultiPoint", "description": "`GeoJSON MultiPoint` geometry." }, { "name": "GeoJsonLineString", "value": "LineString", "description": "`GeoJSON LineString` geometry." }, { "name": "GeoJsonMultiLineString", "value": "MultiLineString", "description": "`GeoJSON MultiLineString` geometry." }, { "name": "GeoJsonPolygon", "value": "Polygon", "description": "`GeoJSON Polygon` geometry." }, { "name": "GeoJsonMultiPolygon", "value": "MultiPolygon", "description": "`GeoJSON MultiPolygon` geometry." }, { "name": "GeoJsonGeometryCollection", "value": "GeometryCollection", "description": "`GeoJSON GeometryCollection` geometry." }, { "name": "GeoJsonFeature", "value": "Feature", "description": "`GeoJSON Feature` object." }, { "name": "GeoJsonFeatureCollection", "value": "FeatureCollection", "description": "`GeoJSON FeatureCollection` object." } ] } }, "GeoJsonPoint": { "type": "object", "description": "A valid `GeoJSON Point` geometry type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details.", "properties": { "coordinates": { "type": "array", "description": "A `Position` is an array of numbers with two or more elements. The first two\nelements are _longitude_ and _latitude_, precisely in that order.\n_Altitude/Elevation_ is an optional third element. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.1) for details.", "items": { "type": "number", "format": "double" } } }, "required": [ "coordinates" ], "allOf": [ { "$ref": "#/definitions/GeoJsonGeometry" } ], "x-ms-discriminator-value": "Point" }, "GeoJsonPolygon": { "type": "object", "description": "A valid `GeoJSON Polygon` geometry type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.6) for details.", "properties": { "coordinates": { "type": "array", "description": "Coordinates for the `GeoJson Polygon` geometry type.", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "double" } } } } }, "required": [ "coordinates" ], "allOf": [ { "$ref": "#/definitions/GeoJsonGeometry" } ], "x-ms-discriminator-value": "Polygon" }, "IncidentType": { "type": "string", "description": "Specifies the type of traffic incident. This can be used to request and\ndifferentiate between various types of incidents.", "enum": [ "Accident", "Congestion", "DisabledVehicle", "Miscellaneous", "RoadHazard", "Construction", "Weather" ], "x-ms-enum": { "name": "IncidentType", "modelAsString": true, "values": [ { "name": "Accident", "value": "Accident", "description": "Accident" }, { "name": "Congestion", "value": "Congestion", "description": "Congestion" }, { "name": "DisabledVehicle", "value": "DisabledVehicle", "description": "DisabledVehicle" }, { "name": "Miscellaneous", "value": "Miscellaneous", "description": "Miscellaneous" }, { "name": "RoadHazard", "value": "RoadHazard", "description": "RoadHazard" }, { "name": "Construction", "value": "Construction", "description": "Construction" }, { "name": "Weather", "value": "Weather", "description": "Weather" } ] } }, "TrafficIncidentFeatureProperties": { "type": "object", "description": "Specifies detailed information about the traffic incidents.", "properties": { "description": { "type": "string", "description": "A description of the incident that includes the road name and the event\nimpacting the traffic flow.\n\nExamples:\n\n• W 95th St between Switzer Rd and Bluejacket Dr - construction\n\n• WB Johnson Dr at I-435 - bridge repair" }, "startTime": { "type": "string", "description": "The date and time in UTC when the incident occurred, formatted as a dateTime\nvalue as defined in [RFC 3339, section\n5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6)." }, "endTime": { "type": "string", "description": "The date and time in UTC when the traffic incident will end, formatted as a\ndateTime value as defined in [RFC 3339, section\n5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6)." }, "lastModifiedTime": { "type": "string", "description": "The date and time in UTC when the incident information was last updated,\nformatted as a dateTime value as defined in [RFC 3339, section\n5.6](https://www.rfc-editor.org/rfc/rfc3339#section-5.6)." }, "isRoadClosed": { "type": "boolean", "description": "A value of `true` indicates that there is a road closure." }, "severity": { "type": "integer", "format": "int32", "description": "Specifies the level of importance of the incident.\n\n- 0: Unknown\n\n- 1: Minor\n\n- 2: Moderate\n\n- 3: Major\n\n- 4: Undefined (used for road closures and other indefinite delays)" }, "incidentType": { "$ref": "#/definitions/IncidentType", "description": "Specifies the type of traffic incident. This can be used to request and\ndifferentiate between various types of incidents." }, "title": { "type": "string", "description": "Specifies the road names and direction of affected roads." }, "delay": { "type": "number", "format": "double", "description": "The delay caused by the incident in seconds. If no delay or not applicable, it\nreturns zero." }, "endPoint": { "type": "object", "description": "A GeoJson Point object that specified the end location of a traffic incident\nsuch as end of a construction zone.\n\nThis location is part of the incident properties object and by default, cannot\nbe interpreted by parsers for display on the map.", "additionalProperties": {} }, "isTrafficJam": { "type": "boolean", "description": "A value of `true` indicates that the area of road covered by this incident is\nexperiencing abnormal traffic conditions resulting in non-typical delays." } } }, "TrafficIncidentFeaturesItem": { "type": "object", "description": "GeoJSON feature object that contains Geometry object and additional properties\nof traffic incidents.", "properties": { "type": { "$ref": "#/definitions/FeaturesItemTypeEnum", "description": "Specifies the `GeoJSON` type. The only supported object type is Feature. For\nmore information, see [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946)." }, "id": { "type": "integer", "format": "int64", "description": "A unique ID for the incident." }, "geometry": { "$ref": "#/definitions/GeoJsonPoint", "description": "A valid `GeoJSON Point` geometry type. Please refer to [RFC\n7946](https://tools.ietf.org/html/rfc7946#section-3.1.2) for details." }, "properties": { "$ref": "#/definitions/TrafficIncidentFeatureProperties", "description": "Specifies detailed information about the traffic incidents." } } }, "TrafficIncidentResponse": { "type": "object", "description": "A GeoJSON feature collection object that contains a list of traffic incidents\nfeatures.", "properties": { "type": { "$ref": "#/definitions/FeatureTypeEnum", "description": "Specifies the `GeoJSON` type. The only supported object type is\n`FeatureCollection`. For more information, see [RFC\n7946](https://www.rfc-editor.org/rfc/rfc7946)." }, "features": { "type": "array", "description": "`GeoJSON` feature object that contains Geometry object and additional\nproperties. Refer to [RFC 7946, Section\n3.2](https://www.rfc-editor.org/rfc/rfc7946#section-3.2) for details.", "items": { "$ref": "#/definitions/TrafficIncidentFeaturesItem" } } } } }, "parameters": { "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for this operation.", "required": true, "type": "string", "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" } } }