forked from raml-apis/Uber
-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.raml
197 lines (194 loc) · 8.21 KB
/
api.raml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#%RAML 0.8
title: Uber
version: v1
baseUri: https://{apiMode}.uber.com/{version}
baseUriParameters:
apiMode:
description: In order to use the Sandbox environment set 'sandbox-api'. Otherwise set 'api'.
enum: [ sandbox-api, api ]
securitySchemes:
- oauth_2_0: !include securitySchemes/oauth_2_0.raml
- bearer: !include securitySchemes/bearer.raml
schemas:
- productsResponse: !include schemas/productsResponse-schema.json
- productResponse: !include schemas/productResponse-schema.json
- priceResponse: !include schemas/priceResponse-schema.json
- timeResponse: !include schemas/timeResponse-schema.json
- promotionsResponse: !include schemas/promotionsResponse-schema.json
- userResponse: !include schemas/userResponse-schema.json
- reguestsResponse: !include schemas/reguestsResponse-schema.json
- requestsConflictResponse: !include schemas/requestsConflictResponse-schema.json
- requestResponse: !include schemas/requestResponse-schema.json
- requestEstimateResponse: !include schemas/requestEstimateResponse-schema.json
- mapRequestResponse: !include schemas/mapRequestResponse-schema.json
- receiptRequestResponse: !include schemas/receiptRequestResponse-schema.json
traits:
- points: !include traits/points.raml
securedBy: [ oauth_2_0 ]
/products:
get:
description: |
The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.
Some Products, such as experiments or promotions such as UberPOOL and UberFRESH, will not be returned by this endpoint.
queryParameters:
latitude:
description: Latitude component of location.
type: number
required: true
longitude:
description: Longitude component of location.
type: number
required: true
responses:
200:
body:
application/json:
schema: productsResponse
example: !include examples/productsResponse-example.json
/{product_id}:
get:
description: Returns information about the Uber product.
responses:
200:
body:
application/json:
schema: productResponse
example: !include examples/productResponse-example.json
/estimates:
/price:
get:
is: [ points ]
description: |
The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.
The response also includes low and high estimates, and the ISO 4217 currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.
responses:
200:
body:
application/json:
schema: priceResponse
example: !include examples/priceResponse-example.json
/time:
get:
description: The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.
queryParameters:
start_latitude:
description: Latitude component.
type: number
required: true
start_longitude:
description: Longitude component.
type: number
required: true
"customer_uuid ":
description: Unique customer identifier to be used for experience customization.
"product_id ":
description: Unique identifier representing a specific product for a given latitude & longitude.
responses:
200:
body:
application/json:
schema: timeResponse
example: !include examples/timeResponse-example.json
/promotions:
get:
is: [ points ]
description: "The Promotions endpoint returns information about the promotion that will be available to a new user based on their activity's location. These promotions do not apply for existing users."
responses:
200:
body:
application/json:
schema: promotionsResponse
example: !include examples/promotionsResponse-example.json
/me:
get:
description: The User Profile endpoint returns information about the Uber user that has authorized with the application.
responses:
200:
body:
application/json:
schema: userResponse
example: !include examples/userResponse-example.json
/requests:
post:
is: [ points ]
description: The Request endpoint allows a ride to be requested on behalf of an Uber user given their desired product, start, and end locations.
queryParameters:
product_id:
description: The unique ID of the product being requested.
required: true
surge_confirmation_id:
description: The unique identifier of the surge session for a user. Required when returned from a 409 Conflict response on previous POST attempt.
responses:
200:
body:
application/json:
schema: reguestsResponse
example: !include examples/reguestsResponse-example.json
209:
body:
application/json:
schema: requestsConflictResponse
example: !include examples/requestsConflictResponse-example.json
/{request_id}:
get:
description: Get the real time status of an ongoing trip that was created using the Ride Request endpoint.
responses:
200:
body:
application/json:
schema: requestResponse
example: !include examples/requestResponse-example.json
delete:
description: Cancel an ongoing Request on behalf of a rider.
responses:
204:
/receipt:
get:
description: Get the receipt information of the completed request.
responses:
200:
body:
application/json:
schema: receiptRequestResponse
example: !include examples/receiptRequestResponse-example.json
/map:
get:
description: Get a map with a visual representation of a Request.
responses:
200:
body:
application/json:
schema: mapRequestResponse
example: !include examples/mapRequestResponse-example.json
/estimate:
post:
description: |
The Request Estimate endpoint allows a ride to be estimated given the desired product, start, and end locations. If the end location is not provided, only the pickup ETA and details of surge pricing information are provided. If the pickup ETA is null, there are no cars available, but an estimate may still be given to the user.
You can use this endpoint to determine if surge pricing is in effect. Do this before attempting to make a request so that you can preemptively have a user confirm surge by sending them to the surge_confirmation_href provided in the response.
queryParameters:
product_id:
description: The unique ID of the product being requested.
required: true
start_latitude:
description: 'The beginning or "pickup" latitude.'
type: number
required: true
start_longitude:
description: 'The beginning or "pickup" longitude.'
type: number
required: true
end_latitude:
description: The final or destination latitude. If not included, only the pickup ETA and details of surge pricing will be included.
type: number
end_longitude:
description: The final or destination longitude. If not included, only the pickup ETA and details of surge pricing will be included.
type: number
responses:
200:
body:
application/json:
schema: requestEstimateResponse
example: !include examples/requestEstimateResponse-example.json
documentation:
- title: Headline
content: !include docs/api/headline.md