Skip to content

Commit 338669f

Browse files
authored
Merge pull request #112352 from anastasia-ms/bike
removing dock bike
2 parents 19133b4 + 92defd1 commit 338669f

File tree

1 file changed

+8
-103
lines changed

1 file changed

+8
-103
lines changed

articles/azure-maps/how-to-request-real-time-data.md

Lines changed: 8 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
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
66
ms.date: 09/06/2019
77
ms.topic: conceptual
88
ms.service: azure-maps
@@ -11,28 +11,21 @@ manager: philmea
1111
ms.custom: mvc
1212
---
1313

14-
# Request real-time data using the Azure Maps Mobility Service
14+
# Request real-time public transit data using the Azure Maps Mobility Service
1515

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.
2317

18+
In this article, you will learn how to request next real-time arrivals for all lines arriving at a given stop
2419

2520
## Prerequisites
2621

2722
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).
2823

29-
3024
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.
3125

32-
3326
## Request real-time arrivals for a stop
3427

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).
3629

3730
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:
3831

@@ -113,94 +106,6 @@ Let's use "522" as our metro ID, which is the metro ID for the "Seattle–Tacom
113106
}
114107
```
115108
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**.
131-
132-
```HTTP
133-
https://atlas.microsoft.com/mobility/transit/nearby/json?subscription-key={subscription-key}&api-version=1.0&metroId=121&query=40.7663753,-73.9627498&radius=100&objectType=bikeDock
134-
```
135-
136-
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**.
180-
181-
```HTTP
182-
https://atlas.microsoft.com/mobility/transit/dock/json?subscription-key={subscription-key}&api-version=1.0&query=121---4640799
183-
```
184-
185-
3. After a successful request, you'll receive a response of the following structure:
186-
187-
```JSON
188-
{
189-
"availableVehicles": 0,
190-
"vacantLocations": 31,
191-
"position": {
192-
"latitude": 40.767128,
193-
"longitude": -73.962246
194-
},
195-
"lastUpdated": "2019-09-07T00:55:19Z",
196-
"operatorInfo": {
197-
"id": "121---80",
198-
"name": "Citi Bike"
199-
}
200-
}
201-
```
202-
203-
204109
## Next steps
205110
206111
Learn how to request transit data using Mobility Service:

0 commit comments

Comments
 (0)