|
| 1 | +# this is an example of the Uber API |
| 2 | +# as a demonstration of an API spec in YAML |
| 3 | +swagger: "2.0" |
| 4 | +info: |
| 5 | + title: Uber API |
| 6 | + description: Move your app forward with the Uber API |
| 7 | + version: "1.0.0" |
| 8 | +# the domain of the service |
| 9 | +host: ap.uber.com |
| 10 | +# array of all schemes that your API supports |
| 11 | +schemes: |
| 12 | + - https |
| 13 | +# will be prefixed to all paths |
| 14 | +basePath: /v1 |
| 15 | +produces: |
| 16 | + - application/json |
| 17 | +paths: |
| 18 | + /Pr_oducts: |
| 19 | + get: |
| 20 | + operationId: getProducts |
| 21 | + summary: Product Types |
| 22 | + 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. |
| 23 | + parameters: |
| 24 | + - name: latitude |
| 25 | + in: query |
| 26 | + description: Latitude component of location. |
| 27 | + required: true |
| 28 | + type: number |
| 29 | + format: double |
| 30 | + - name: longitude |
| 31 | + in: query |
| 32 | + description: Longitude component of location. |
| 33 | + required: true |
| 34 | + type: number |
| 35 | + format: double |
| 36 | + tags: |
| 37 | + - Products |
| 38 | + responses: |
| 39 | + 200: |
| 40 | + description: An array of products |
| 41 | + schema: |
| 42 | + type: array |
| 43 | + items: |
| 44 | + $ref: '#/definitions/Product' |
| 45 | + default: |
| 46 | + description: Unexpected error |
| 47 | + schema: |
| 48 | + $ref: '#/definitions/Error' |
| 49 | + /estimates/price: |
| 50 | + get: |
| 51 | + operationId: get_EstimatePrice |
| 52 | + summary: Price Estimates |
| 53 | + 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.<br><br>The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/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. |
| 54 | + parameters: |
| 55 | + - name: start_latitude |
| 56 | + in: query |
| 57 | + description: Latitude component of start location. |
| 58 | + required: true |
| 59 | + type: number |
| 60 | + format: double |
| 61 | + - name: start_longitude |
| 62 | + in: query |
| 63 | + description: Longitude component of start location. |
| 64 | + required: true |
| 65 | + type: number |
| 66 | + format: double |
| 67 | + - name: end_latitude |
| 68 | + in: query |
| 69 | + description: Latitude component of end location. |
| 70 | + required: true |
| 71 | + type: number |
| 72 | + format: double |
| 73 | + - name: end_longitude |
| 74 | + in: query |
| 75 | + description: Longitude component of end location. |
| 76 | + required: true |
| 77 | + type: number |
| 78 | + format: double |
| 79 | + tags: |
| 80 | + - Estimates |
| 81 | + responses: |
| 82 | + 200: |
| 83 | + description: An array of price estimates by product |
| 84 | + schema: |
| 85 | + type: array |
| 86 | + items: |
| 87 | + $ref: '#/definitions/PriceEstimate' |
| 88 | + default: |
| 89 | + description: Unexpected error |
| 90 | + schema: |
| 91 | + $ref: '#/definitions/Error' |
| 92 | + /estimates/time: |
| 93 | + get: |
| 94 | + operationId: getEstimateTime |
| 95 | + summary: Time Estimates |
| 96 | + 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. |
| 97 | + parameters: |
| 98 | + - name: start_latitude |
| 99 | + in: query |
| 100 | + description: Latitude component of start location. |
| 101 | + required: true |
| 102 | + type: number |
| 103 | + format: double |
| 104 | + - name: start_longitude |
| 105 | + in: query |
| 106 | + description: Longitude component of start location. |
| 107 | + required: true |
| 108 | + type: number |
| 109 | + format: double |
| 110 | + - name: customer_uuid |
| 111 | + in: query |
| 112 | + type: string |
| 113 | + format: uuid |
| 114 | + description: Unique customer identifier to be used for experience customization. |
| 115 | + - name: product_id |
| 116 | + in: query |
| 117 | + type: string |
| 118 | + description: Unique identifier representing a specific product for a given latitude & longitude. |
| 119 | + tags: |
| 120 | + - Estimates |
| 121 | + responses: |
| 122 | + 200: |
| 123 | + description: An array of products |
| 124 | + schema: |
| 125 | + type: array |
| 126 | + items: |
| 127 | + $ref: '#/definitions/Product' |
| 128 | + default: |
| 129 | + description: Unexpected error |
| 130 | + schema: |
| 131 | + $ref: '#/definitions/Error' |
| 132 | + /me: |
| 133 | + get: |
| 134 | + operationId: getMe |
| 135 | + summary: User Profile |
| 136 | + description: The User Profile endpoint returns information about the Uber user that has authorized with the application. |
| 137 | + tags: |
| 138 | + - User |
| 139 | + responses: |
| 140 | + 200: |
| 141 | + description: Profile information for a user |
| 142 | + schema: |
| 143 | + $ref: '#/definitions/Profile' |
| 144 | + default: |
| 145 | + description: Unexpected error |
| 146 | + schema: |
| 147 | + $ref: '#/definitions/Error' |
| 148 | + /history: |
| 149 | + get: |
| 150 | + operationId: getHistory |
| 151 | + summary: User Activity |
| 152 | + description: "The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary." |
| 153 | + parameters: |
| 154 | + - $ref: "#/parameters/OffsetParam" |
| 155 | + - $ref: "#/parameters/LimitParam" |
| 156 | + tags: |
| 157 | + - User |
| 158 | + responses: |
| 159 | + 200: |
| 160 | + description: History information for the given user |
| 161 | + schema: |
| 162 | + $ref: '#/definitions/Activities' |
| 163 | + default: |
| 164 | + description: Unexpected error |
| 165 | + schema: |
| 166 | + $ref: '#/definitions/Error' |
| 167 | + |
| 168 | +parameters: |
| 169 | + OffsetParam: |
| 170 | + name: offset |
| 171 | + in: query |
| 172 | + type: integer |
| 173 | + format: int32 |
| 174 | + description: Offset the list of returned results by this amount. Default is zero. |
| 175 | + LimitParam: |
| 176 | + name: limit |
| 177 | + in: query |
| 178 | + type: integer |
| 179 | + format: int32 |
| 180 | + description: Number of items to retrieve. Default is 5, maximum is 100. |
| 181 | + |
| 182 | +definitions: |
| 183 | + Product: |
| 184 | + properties: |
| 185 | + product_id: |
| 186 | + type: string |
| 187 | + description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. |
| 188 | + format: uuid |
| 189 | + description: |
| 190 | + type: string |
| 191 | + description: Description of product. |
| 192 | + display_name: |
| 193 | + type: string |
| 194 | + description: Display name of product. |
| 195 | + capacity: |
| 196 | + type: string |
| 197 | + description: Capacity of product. For example, 4 people. |
| 198 | + image: |
| 199 | + type: string |
| 200 | + description: Image URL representing the product. |
| 201 | + format: uri |
| 202 | + PriceEstimate: |
| 203 | + properties: |
| 204 | + product_id: |
| 205 | + type: string |
| 206 | + description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles |
| 207 | + format: uuid |
| 208 | + currency_code: |
| 209 | + $ref: "#/definitions/CurrencyCode" |
| 210 | + display_name: |
| 211 | + type: string |
| 212 | + description: Display name of product. |
| 213 | + estimate: |
| 214 | + type: string |
| 215 | + description: Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI. |
| 216 | + low_estimate: |
| 217 | + type: number |
| 218 | + description: Lower bound of the estimated price. |
| 219 | + high_estimate: |
| 220 | + type: number |
| 221 | + description: Upper bound of the estimated price. |
| 222 | + surge_multiplier: |
| 223 | + type: number |
| 224 | + description: Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier. |
| 225 | + Profile: |
| 226 | + properties: |
| 227 | + first_name: |
| 228 | + type: string |
| 229 | + description: First name of the Uber user. |
| 230 | + last_name: |
| 231 | + type: string |
| 232 | + description: Last name of the Uber user. |
| 233 | + email: |
| 234 | + type: string |
| 235 | + description: Email address of the Uber user |
| 236 | + picture: |
| 237 | + type: string |
| 238 | + description: Image URL of the Uber user. |
| 239 | + promo_code: |
| 240 | + type: string |
| 241 | + description: Promo code of the Uber user. |
| 242 | + Activity: |
| 243 | + properties: |
| 244 | + uuid: |
| 245 | + type: string |
| 246 | + description: Unique identifier for the activity |
| 247 | + Activities: |
| 248 | + properties: |
| 249 | + offset: |
| 250 | + type: integer |
| 251 | + format: int32 |
| 252 | + description: Position in pagination. |
| 253 | + limit: |
| 254 | + type: integer |
| 255 | + format: int32 |
| 256 | + description: Number of items to retrieve (100 max). |
| 257 | + count: |
| 258 | + type: integer |
| 259 | + format: int32 |
| 260 | + description: Total number of items available. |
| 261 | + history: |
| 262 | + type: array |
| 263 | + items: |
| 264 | + - $ref: '#/definitions/Activity' |
| 265 | + CurrencyCode: |
| 266 | + type: string |
| 267 | + description: "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code." |
| 268 | + format: currency-code |
| 269 | + Error: |
| 270 | + properties: |
| 271 | + code: |
| 272 | + type: integer |
| 273 | + format: int32 |
| 274 | + message: |
| 275 | + type: string |
| 276 | + fields: |
| 277 | + type: string |
0 commit comments