{ "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