Advertisement
Guest User

Untitled

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