Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.88 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: "centralized turtle base pair exchange."
  4. version: "1.0.0"
  5. title: "trtl.exchange"
  6.  
  7. host: "simple.api"
  8. basePath: "/v2"
  9. schemes:
  10. - "https"
  11. paths:
  12. /order:
  13. post:
  14. tags:
  15. - "order"
  16. summary: "Add a new order to the queue"
  17. description: ""
  18. operationId: "addOrder"
  19. consumes:
  20. - "application/json"
  21. produces:
  22. - "application/json"
  23. parameters:
  24. - in: "body"
  25. name: "body"
  26. description: "Order object that needs to be added to the queue"
  27. required: true
  28. schema:
  29. $ref: "#/definitions/Order"
  30. responses:
  31. 405:
  32. description: "Invalid input"
  33. security:
  34. - exchange_auth:
  35. - "write:orders"
  36. - "read:orders"
  37.  
  38. /order/{orderId}:
  39. get:
  40. tags:
  41. - "order"
  42. summary: "Find order by ID"
  43. description: "Returns a single order"
  44. operationId: "getOrderById"
  45. produces:
  46. - "application/json"
  47. parameters:
  48. - name: "orderId"
  49. in: "path"
  50. description: "ID of order to return"
  51. required: true
  52. type: "integer"
  53. format: "int64"
  54. responses:
  55. 200:
  56. description: "successful operation"
  57. schema:
  58. $ref: "#/definitions/Order"
  59. 400:
  60. description: "Invalid ID supplied"
  61. 404:
  62. description: "Order not found"
  63. security:
  64. - api_key: []
  65. put:
  66. tags:
  67. - "order"
  68. summary: "Updates an order in the store with form data"
  69. description: ""
  70. operationId: "updateOrderWithForm"
  71. consumes:
  72. - "application/x-www-form-urlencoded"
  73. produces:
  74. - "application/json"
  75. parameters:
  76. - name: "orderId"
  77. in: "path"
  78. description: "ID of order that needs to be updated"
  79. required: true
  80. type: "integer"
  81. format: "int64"
  82. - name: "name"
  83. in: "formData"
  84. description: "Updated name of the order"
  85. required: false
  86. type: "string"
  87. - name: "status"
  88. in: "formData"
  89. description: "Updated status of the order"
  90. required: false
  91. type: "string"
  92. responses:
  93. 405:
  94. description: "Invalid input"
  95. delete:
  96. tags:
  97. - "order"
  98. summary: "Deletes an order"
  99. description: ""
  100. operationId: "deleteOrder"
  101. produces:
  102. - "application/json"
  103. parameters:
  104. - name: "api_key"
  105. in: "header"
  106. required: false
  107. type: "string"
  108. - name: "orderId"
  109. in: "path"
  110. description: "order id to delete"
  111. required: true
  112. type: "integer"
  113. format: "int64"
  114. responses:
  115. 400:
  116. description: "Invalid ID supplied"
  117. 404:
  118. description: "Order not found"
  119. /market:
  120. get:
  121. tags:
  122. - "market"
  123. summary: "get info about every market."
  124. description: ""
  125. operationId: "getMarket"
  126. consumes:
  127. - "application/json"
  128. produces:
  129. - "application/json"
  130. parameters:
  131. - name: "api_key"
  132. in: "header"
  133. required: false
  134. type: "string"
  135. - name: "orderId"
  136. in: "path"
  137. description: "order id to delete"
  138. required: true
  139. type: "integer"
  140. format: "int64"
  141. responses:
  142. 400:
  143. description: "Invalid ID supplied"
  144. 404:
  145. description: "Order not found"
  146. /market/trtl-mtip:
  147. get:
  148. tags:
  149. - "market"
  150. summary: "get info about trtl-mtip market"
  151. description: "get info about trtl-mtip market"
  152. operationId: "getMtip"
  153. produces:
  154. - "application/json"
  155. responses:
  156. 200:
  157. description: "successful operation"
  158. schema:
  159. $ref: "#/definitions/Order"
  160. 400:
  161. description: "Invalid ID supplied"
  162. 404:
  163. description: "Order not found"
  164. security:
  165. - api_key: []
  166.  
  167. /market/trtl-ple:
  168. get:
  169. tags:
  170. - "market"
  171. summary: "get info about trtl-ple market"
  172. description: "get info about trtl-ple market"
  173. operationId: "getPle"
  174. produces:
  175. - "application/json"
  176. responses:
  177. 200:
  178. description: "successful operation"
  179. schema:
  180. $ref: "#/definitions/Order"
  181. 400:
  182. description: "Invalid ID supplied"
  183. 404:
  184. description: "Order not found"
  185. security:
  186. - api_key: []
  187.  
  188. /market/trtl-xmlc:
  189. get:
  190. tags:
  191. - "market"
  192. summary: "get info about trtl-xmlc market"
  193. description: "get info about trtl-xmlc market"
  194. operationId: "getXmlc"
  195. produces:
  196. - "application/json"
  197. responses:
  198. 200:
  199. description: "successful operation"
  200. schema:
  201. $ref: "#/definitions/Order"
  202. 400:
  203. description: "Invalid ID supplied"
  204. 404:
  205. description: "Order not found"
  206. security:
  207. - api_key: []
  208. /user/{username}/wallet:
  209. post:
  210. tags:
  211. - "wallet"
  212. summary: "Add a new order to the queue"
  213. description: "username"
  214. operationId: "addWallet"
  215. consumes:
  216. - "application/json"
  217. produces:
  218. - "application/json"
  219. parameters:
  220. - name: username
  221. in: query
  222. description: user
  223. type: string
  224. responses:
  225. 405:
  226. description: "Invalid input"
  227. put:
  228. tags:
  229. - "wallet"
  230. summary: "Update an existing wallet"
  231. description: ""
  232. consumes:
  233. - "application/json"
  234. produces:
  235. - "application/json"
  236. responses:
  237. 400:
  238. description: "Invalid ID supplied"
  239. 404:
  240. description: "Wallet not found"
  241. 405:
  242. description: "Validation exception"
  243.  
  244. /user:
  245. post:
  246. tags:
  247. - "user"
  248. summary: "Create user"
  249. description: "This can only be done by the logged in user."
  250. operationId: "createUser"
  251. produces:
  252. - "application/json"
  253. responses:
  254. 200:
  255. description: "successful operation"
  256. schema:
  257. type: "string"
  258. headers:
  259. X-Rate-Limit:
  260. type: "integer"
  261. format: "int32"
  262. description: "calls per hour allowed by the user"
  263. X-Expires-After:
  264. type: "string"
  265. format: "date-time"
  266. description: "date in UTC when token expires"
  267. 400:
  268. description: "Invalid username/password supplied"
  269. /user/login:
  270. get:
  271. tags:
  272. - "user"
  273. summary: "Logs user into the system"
  274. description: ""
  275. operationId: "loginUser"
  276. produces:
  277. - "application/json"
  278. parameters:
  279. - name: "username"
  280. in: "query"
  281. description: "The user name for login"
  282. required: true
  283. type: "string"
  284. - name: "password"
  285. in: "query"
  286. description: "The password for login in clear text"
  287. required: true
  288. type: "string"
  289. responses:
  290. 200:
  291. description: "successful operation"
  292. schema:
  293. type: "string"
  294. headers:
  295. X-Rate-Limit:
  296. type: "integer"
  297. format: "int32"
  298. description: "calls per hour allowed by the user"
  299. X-Expires-After:
  300. type: "string"
  301. format: "date-time"
  302. description: "date in UTC when token expires"
  303. 400:
  304. description: "Invalid username/password supplied"
  305. /user/logout:
  306. get:
  307. tags:
  308. - "user"
  309. summary: "Logs out current logged in user session"
  310. description: ""
  311. operationId: "logoutUser"
  312. produces:
  313. - "application/json"
  314. parameters: []
  315. responses:
  316. default:
  317. description: "successful operation"
  318. /user/{username}:
  319. get:
  320. tags:
  321. - "user"
  322. summary: "Get user by user name"
  323. description: "user"
  324. operationId: "getUserByName"
  325. produces:
  326. - "application/json"
  327. parameters:
  328. - name: "username"
  329. in: "path"
  330. description: "The name that needs to be fetched. Use user1 for testing. "
  331. required: true
  332. type: "string"
  333. responses:
  334. 200:
  335. description: "successful operation"
  336. 400:
  337. description: "Invalid username supplied"
  338. 404:
  339. description: "User not found"
  340. put:
  341. tags:
  342. - "user"
  343. summary: "Updated user"
  344. description: "This can only be done by the logged in user."
  345. operationId: "updateUser"
  346. produces:
  347. - "application/json"
  348. parameters:
  349. - name: "username"
  350. in: "path"
  351. description: "name that need to be updated"
  352. required: true
  353. type: "string"
  354. - in: "body"
  355. name: "body"
  356. description: "Updated user object"
  357. required: true
  358. schema:
  359. $ref: "#/definitions/User"
  360. responses:
  361. 400:
  362. description: "Invalid user supplied"
  363. 404:
  364. description: "User not found"
  365. delete:
  366. tags:
  367. - "user"
  368. summary: "Delete user"
  369. description: "This can only be done by the logged in user."
  370. operationId: "deleteUser"
  371. produces:
  372. - "application/json"
  373. parameters:
  374. - name: "username"
  375. in: "path"
  376. description: "The name that needs to be deleted"
  377. required: true
  378. type: "string"
  379. responses:
  380. 400:
  381. description: "Invalid username supplied"
  382. 404:
  383. description: "User not found"
  384. securityDefinitions:
  385. exchange_auth:
  386. type: "oauth2"
  387. authorizationUrl: "http://orderstore.swagger.io/oauth/dialog"
  388. flow: "implicit"
  389. scopes:
  390. write:orders: "modify orders in your account"
  391. read:orders: "read your orders"
  392. api_key:
  393. type: "apiKey"
  394. name: "api_key"
  395. in: "header"
  396. definitions:
  397.  
  398. User:
  399. type: "object"
  400. properties:
  401. id:
  402. type: "integer"
  403. format: "int64"
  404. username:
  405. type: "string"
  406. firstName:
  407. type: "string"
  408. lastName:
  409. type: "string"
  410. email:
  411. type: "string"
  412. password:
  413. type: "string"
  414. userStatus:
  415. type: "integer"
  416. format: "int32"
  417. description: "User Status"
  418.  
  419. Order:
  420. type: "object"
  421. required:
  422. - "name"
  423. - "photoUrls"
  424. properties:
  425. id:
  426. type: "integer"
  427. format: "int64"
  428. name:
  429. type: "string"
  430. example: "doggie"
  431. status:
  432. type: "string"
  433. description: "order status in the store"
  434. enum:
  435. - "available"
  436. - "pending"
  437. - "sold"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement