You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/how-to-request-real-time-data.md
+8-103Lines changed: 8 additions & 103 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
-
title: Request real-time transit data | Microsoft Azure Maps
3
-
description: Request real-time data using the Microsoft Azure Maps Mobility Service.
4
-
author: philmea
5
-
ms.author: philmea
2
+
title: Request real-time public transit data | Microsoft Azure Maps
3
+
description: Request real-time public transit data using the Microsoft Azure Maps Mobility Service.
4
+
author: anastasia-ms
5
+
ms.author: v-stharr
6
6
ms.date: 09/06/2019
7
7
ms.topic: conceptual
8
8
ms.service: azure-maps
@@ -11,28 +11,21 @@ manager: philmea
11
11
ms.custom: mvc
12
12
---
13
13
14
-
# Request real-time data using the Azure Maps Mobility Service
14
+
# Request real-time public transit data using the Azure Maps Mobility Service
15
15
16
-
This article shows you how to use Azure Maps [Mobility Service](https://aka.ms/AzureMapsMobilityService) to request real-time transit data.
17
-
18
-
In this article you'll learn how to:
19
-
20
-
21
-
* Request next real-time arrivals for all lines arriving at a given stop
22
-
* Request real-time information for a given bike docking station.
16
+
This article shows you how to use Azure Maps [Mobility Service](https://aka.ms/AzureMapsMobilityService) to request real-time public transit data.
23
17
18
+
In this article, you will learn how to request next real-time arrivals for all lines arriving at a given stop
24
19
25
20
## Prerequisites
26
21
27
22
You first need to have an Azure Maps account and a subscription key to make any calls to the Azure Maps public transit APIs. For information, follow instructions in [Create an account](quick-demo-map-app.md#create-an-account-with-azure-maps) to create an Azure Maps account. Follow the steps in [get primary key](quick-demo-map-app.md#get-the-primary-key-for-your-account) to obtain the primary key for your account. For more information on authentication in Azure Maps, see [manage authentication in Azure Maps](./how-to-manage-authentication.md).
28
23
29
-
30
24
This article uses the [Postman app](https://www.getpostman.com/apps) to build REST calls. You can use any API development environment that you prefer.
31
25
32
-
33
26
## Request real-time arrivals for a stop
34
27
35
-
In order to request real-time arrivals data of a particular public transit stop, you'll need to make request to the [Real-time Arrivals API](https://aka.ms/AzureMapsMobilityRealTimeArrivals) of the Azure Maps [Mobility Service](https://aka.ms/AzureMapsMobilityService). You'll need the **metroID** and **stopID** to complete the request. To learn more about how to request these parameters, see our guide on how to [request public transit routes](https://aka.ms/AMapsHowToGuidePublicTransitRouting).
28
+
In order to request real-time arrivals data of a particular public transit stop, you'll need to make request to the [Real-time Arrivals API](https://aka.ms/AzureMapsMobilityRealTimeArrivals) of the Azure Maps [Mobility Service](https://aka.ms/AzureMapsMobilityService). You'll need the **metroID** and **stopID** to complete the request. To learn more about how to request these parameters, see our guide on how to [request public transit routes](https://aka.ms/AMapsHowToGuidePublicTransitRouting).
36
29
37
30
Let's use "522" as our metro ID, which is the metro ID for the "Seattle–Tacoma–Bellevue, WA" area. Use "522---2060603" as the stop ID, this bus stop is at "Ne 24th St & 162nd Ave Ne, Bellevue WA". To request the next five real-time arrivals data, for all next live arrivals at this stop, complete the following steps:
38
31
@@ -113,94 +106,6 @@ Let's use "522" as our metro ID, which is the metro ID for the "Seattle–Tacom
113
106
}
114
107
```
115
108
116
-
117
-
## Real-time data for bike docking station
118
-
119
-
The [Get Transit Dock Info API](https://aka.ms/AzureMapsMobilityTransitDock) allows users to request static and real-time information. For example, users can request availability and vacancy information for a bike, or a scooter docking station. The [Get Transit Dock Info API](https://aka.ms/AzureMapsMobilityTransitDock) is also part of the Azure Maps [Mobility Service](https://aka.ms/AzureMapsMobilityService).
120
-
121
-
In order to make a request to the [Get Transit Dock Info API](https://aka.ms/AzureMapsMobilityTransitDock), you'll need the **dockId** for that station. You can get the dock ID by making a search request to the [Get Nearby Transit API](https://aka.ms/AzureMapsMobilityNearbyTransit) with the **objectType** parameter assigned to "bikeDock". Follow the steps below to get real-time data of a docking station for bikes.
122
-
123
-
124
-
### Get dock ID
125
-
126
-
To get **dockID**, follow the steps below to make a request to the Get Nearby Transit API:
127
-
128
-
1. In Postman, click **New Request** | **GET request** and name it **Get dock ID**.
129
-
130
-
2. On the Builder tab, select the **GET** HTTP method, enter the following request URL, and click **Send**.
3. After a successful request, you'll receive the following response. Notice that we now have the **id** in the response, which can be used later as a query parameter in the request to the Get Transit Dock Info API.
137
-
138
-
```JSON
139
-
{
140
-
"results": [
141
-
{
142
-
"id": "121---4640799",
143
-
"type": "bikeDock",
144
-
"objectDetails": {
145
-
"availableVehicles": 0,
146
-
"vacantLocations": 31,
147
-
"lastUpdated": "2019-09-07T00:55:19Z",
148
-
"operatorInfo": {
149
-
"id": "121---80",
150
-
"name": "Citi Bike"
151
-
}
152
-
},
153
-
"position": {
154
-
"latitude": 40.767128,
155
-
"longitude": -73.962243
156
-
},
157
-
"viewport": {
158
-
"topLeftPoint": {
159
-
"latitude": 40.768039,
160
-
"longitude": -73.963413
161
-
},
162
-
"btmRightPoint": {
163
-
"latitude": 40.766216,
164
-
"longitude": -73.961072
165
-
}
166
-
}
167
-
}
168
-
]
169
-
}
170
-
```
171
-
172
-
173
-
### Get real-time bike dock status
174
-
175
-
Follow the steps below to make a request to the Get Transit Dock Info API to get real-time data for the selected dock.
176
-
177
-
1. In Postman, click **New Request** | **GET request** and name it **Get real-time dock data**.
178
-
179
-
2. On the Builder tab, select the **GET** HTTP method, enter the following request URL, and click **Send**.
0 commit comments