Advertisement
Guest User

Untitled

a guest
Oct 24th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.41 KB | None | 0 0
  1. {
  2. "openapi": "3.0.0",
  3. "info": {
  4. "title": "Uber API",
  5. "description": "Move your app forward with the Uber API",
  6. "version": "1.0.0"
  7. },
  8. "servers": [
  9. {
  10. "url": "https://api.uber.com/v1"
  11. }
  12. ],
  13. "paths": {
  14. "/products": {
  15. "get": {
  16. "summary": "Product Types",
  17. "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.",
  18. "parameters": [
  19. {
  20. "name": "latitude",
  21. "in": "query",
  22. "description": "Latitude component of location.",
  23. "required": true,
  24. "schema": {
  25. "type": "number",
  26. "format": "double"
  27. }
  28. },
  29. {
  30. "name": "longitude",
  31. "in": "query",
  32. "description": "Longitude component of location.",
  33. "required": true,
  34. "schema": {
  35. "type": "number",
  36. "format": "double"
  37. }
  38. }
  39. ],
  40. "security": [
  41. {
  42. "apikey": []
  43. }
  44. ],
  45. "tags": [
  46. "Products"
  47. ],
  48. "responses": {
  49. "200": {
  50. "description": "An array of products",
  51. "content": {
  52. "application/json": {
  53. "schema": {
  54. "$ref": "#/components/schemas/ProductList"
  55. }
  56. }
  57. }
  58. },
  59. "default": {
  60. "description": "Unexpected error",
  61. "content": {
  62. "application/json": {
  63. "schema": {
  64. "$ref": "#/components/schemas/Error"
  65. }
  66. }
  67. }
  68. }
  69. }
  70. }
  71. },
  72. "/estimates/price": {
  73. "get": {
  74. "summary": "Price Estimates",
  75. "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.",
  76. "parameters": [
  77. {
  78. "name": "start_latitude",
  79. "in": "query",
  80. "description": "Latitude component of start location.",
  81. "required": true,
  82. "schema": {
  83. "type": "number",
  84. "format": "double"
  85. }
  86. },
  87. {
  88. "name": "start_longitude",
  89. "in": "query",
  90. "description": "Longitude component of start location.",
  91. "required": true,
  92. "schema": {
  93. "type": "number",
  94. "format": "double"
  95. }
  96. },
  97. {
  98. "name": "end_latitude",
  99. "in": "query",
  100. "description": "Latitude component of end location.",
  101. "required": true,
  102. "schema": {
  103. "type": "number",
  104. "format": "double"
  105. }
  106. },
  107. {
  108. "name": "end_longitude",
  109. "in": "query",
  110. "description": "Longitude component of end location.",
  111. "required": true,
  112. "schema": {
  113. "type": "number",
  114. "format": "double"
  115. }
  116. }
  117. ],
  118. "tags": [
  119. "Estimates"
  120. ],
  121. "responses": {
  122. "200": {
  123. "description": "An array of price estimates by product",
  124. "content": {
  125. "application/json": {
  126. "schema": {
  127. "type": "array",
  128. "items": {
  129. "$ref": "#/components/schemas/PriceEstimate"
  130. }
  131. }
  132. }
  133. }
  134. },
  135. "default": {
  136. "description": "Unexpected error",
  137. "content": {
  138. "application/json": {
  139. "schema": {
  140. "$ref": "#/components/schemas/Error"
  141. }
  142. }
  143. }
  144. }
  145. }
  146. }
  147. },
  148. "/estimates/time": {
  149. "get": {
  150. "summary": "Time Estimates",
  151. "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.",
  152. "parameters": [
  153. {
  154. "name": "start_latitude",
  155. "in": "query",
  156. "description": "Latitude component of start location.",
  157. "required": true,
  158. "schema": {
  159. "type": "number",
  160. "format": "double"
  161. }
  162. },
  163. {
  164. "name": "start_longitude",
  165. "in": "query",
  166. "description": "Longitude component of start location.",
  167. "required": true,
  168. "schema": {
  169. "type": "number",
  170. "format": "double"
  171. }
  172. },
  173. {
  174. "name": "customer_uuid",
  175. "in": "query",
  176. "schema": {
  177. "type": "string",
  178. "format": "uuid"
  179. },
  180. "description": "Unique customer identifier to be used for experience customization."
  181. },
  182. {
  183. "name": "product_id",
  184. "in": "query",
  185. "schema": {
  186. "type": "string"
  187. },
  188. "description": "Unique identifier representing a specific product for a given latitude & longitude."
  189. }
  190. ],
  191. "tags": [
  192. "Estimates"
  193. ],
  194. "responses": {
  195. "200": {
  196. "description": "An array of products",
  197. "content": {
  198. "application/json": {
  199. "schema": {
  200. "type": "array",
  201. "items": {
  202. "$ref": "#/components/schemas/Product"
  203. }
  204. }
  205. }
  206. }
  207. },
  208. "default": {
  209. "description": "Unexpected error",
  210. "content": {
  211. "application/json": {
  212. "schema": {
  213. "$ref": "#/components/schemas/Error"
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. },
  221. "/me": {
  222. "get": {
  223. "summary": "User Profile",
  224. "description": "The User Profile endpoint returns information about the Uber user that has authorized with the application.",
  225. "tags": [
  226. "User"
  227. ],
  228. "responses": {
  229. "200": {
  230. "description": "Profile information for a user",
  231. "content": {
  232. "application/json": {
  233. "schema": {
  234. "$ref": "#/components/schemas/Profile"
  235. }
  236. }
  237. }
  238. },
  239. "default": {
  240. "description": "Unexpected error",
  241. "content": {
  242. "application/json": {
  243. "schema": {
  244. "$ref": "#/components/schemas/Error"
  245. }
  246. }
  247. }
  248. }
  249. }
  250. }
  251. },
  252. "/history": {
  253. "get": {
  254. "summary": "User Activity",
  255. "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.",
  256. "parameters": [
  257. {
  258. "name": "offset",
  259. "in": "query",
  260. "schema": {
  261. "type": "integer",
  262. "format": "int32"
  263. },
  264. "description": "Offset the list of returned results by this amount. Default is zero."
  265. },
  266. {
  267. "name": "limit",
  268. "in": "query",
  269. "schema": {
  270. "type": "integer",
  271. "format": "int32"
  272. },
  273. "description": "Number of items to retrieve. Default is 5, maximum is 100."
  274. }
  275. ],
  276. "tags": [
  277. "User"
  278. ],
  279. "responses": {
  280. "200": {
  281. "description": "History information for the given user",
  282. "content": {
  283. "application/json": {
  284. "schema": {
  285. "$ref": "#/components/schemas/Activities"
  286. }
  287. }
  288. }
  289. },
  290. "default": {
  291. "description": "Unexpected error",
  292. "content": {
  293. "application/json": {
  294. "schema": {
  295. "$ref": "#/components/schemas/Error"
  296. }
  297. }
  298. }
  299. }
  300. }
  301. }
  302. }
  303. },
  304. "components": {
  305. "securitySchemes": {
  306. "apikey": {
  307. "type": "apiKey",
  308. "name": "server_token",
  309. "in": "query"
  310. }
  311. },
  312. "schemas": {
  313. "Product": {
  314. "properties": {
  315. "product_id": {
  316. "type": "string",
  317. "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."
  318. },
  319. "description": {
  320. "type": "string",
  321. "description": "Description of product."
  322. },
  323. "display_name": {
  324. "type": "string",
  325. "description": "Display name of product."
  326. },
  327. "capacity": {
  328. "type": "integer",
  329. "description": "Capacity of product. For example, 4 people."
  330. },
  331. "image": {
  332. "type": "string",
  333. "description": "Image URL representing the product."
  334. }
  335. }
  336. },
  337. "ProductList": {
  338. "properties": {
  339. "products": {
  340. "description": "Contains the list of products",
  341. "type": "array",
  342. "items": {
  343. "$ref": "#/components/schemas/Product"
  344. }
  345. }
  346. }
  347. },
  348. "PriceEstimate": {
  349. "properties": {
  350. "product_id": {
  351. "type": "string",
  352. "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"
  353. },
  354. "currency_code": {
  355. "type": "string",
  356. "description": "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code."
  357. },
  358. "display_name": {
  359. "type": "string",
  360. "description": "Display name of product."
  361. },
  362. "estimate": {
  363. "type": "string",
  364. "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."
  365. },
  366. "low_estimate": {
  367. "type": "number",
  368. "description": "Lower bound of the estimated price."
  369. },
  370. "high_estimate": {
  371. "type": "number",
  372. "description": "Upper bound of the estimated price."
  373. },
  374. "surge_multiplier": {
  375. "type": "number",
  376. "description": "Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier."
  377. }
  378. }
  379. },
  380. "Profile": {
  381. "properties": {
  382. "first_name": {
  383. "type": "string",
  384. "description": "First name of the Uber user."
  385. },
  386. "last_name": {
  387. "type": "string",
  388. "description": "Last name of the Uber user."
  389. },
  390. "email": {
  391. "type": "string",
  392. "description": "Email address of the Uber user"
  393. },
  394. "picture": {
  395. "type": "string",
  396. "description": "Image URL of the Uber user."
  397. },
  398. "promo_code": {
  399. "type": "string",
  400. "description": "Promo code of the Uber user."
  401. }
  402. }
  403. },
  404. "Activity": {
  405. "properties": {
  406. "uuid": {
  407. "type": "string",
  408. "description": "Unique identifier for the activity"
  409. }
  410. }
  411. },
  412. "Activities": {
  413. "properties": {
  414. "offset": {
  415. "type": "integer",
  416. "format": "int32",
  417. "description": "Position in pagination."
  418. },
  419. "limit": {
  420. "type": "integer",
  421. "format": "int32",
  422. "description": "Number of items to retrieve (100 max)."
  423. },
  424. "count": {
  425. "type": "integer",
  426. "format": "int32",
  427. "description": "Total number of items available."
  428. },
  429. "history": {
  430. "type": "array",
  431. "items": {
  432. "$ref": "#/components/schemas/Activity"
  433. }
  434. }
  435. }
  436. },
  437. "Error": {
  438. "properties": {
  439. "code": {
  440. "type": "string"
  441. },
  442. "message": {
  443. "type": "string"
  444. },
  445. "fields": {
  446. "type": "string"
  447. }
  448. }
  449. }
  450. }
  451. }
  452. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement