Advertisement
Guest User

Untitled

a guest
May 9th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: |
  4. This is a sample server.
  5.  
  6. [Learn about Swagger](http://swagger.io) or join the IRC channel `#swagger` on irc.freenode.net.
  7.  
  8. For this sample, you can use the api key `special-key` to test the authorization filters
  9. version: "1.0.0"
  10. title: Pasagi App
  11. termsOfService: http://paduraksa-teknologi.com/terms/
  12. contact:
  13. name: ry.ridwan.yusuf@gmail.com
  14. host: paduraksa-teknologi.com
  15. basePath: /pasagi
  16. schemes:
  17. - http
  18. - https
  19. paths:
  20. /login:
  21. post:
  22. tags:
  23. - auth
  24. summary: Logs user into the system
  25. description: ""
  26. operationId: loginUser
  27. produces:
  28. - application/json
  29. parameters:
  30. - in: header
  31. name: username
  32. description: The user name for login
  33. required: false
  34. type: string
  35. - in: header
  36. name: password
  37. description: The password for login encrypted ()
  38. required: false
  39. type: string
  40. responses:
  41. "200":
  42. description: successful operation
  43. schema:
  44. type: string
  45. "400":
  46. description: Invalid username/password supplied
  47. security:
  48. - x-pasagi-app-id: []
  49. - x-pasagi-app-token: []
  50. - x-pasagi-dev-id: []
  51. - x-pasagi-usr-id: []
  52. - x-pasagi-cc: []
  53. - x-pasagi-dt: []
  54. - x-pasagi-st: []
  55. - x-pasagi-lat: []
  56. - x-pasagi-lon: []
  57. /logout:
  58. get:
  59. tags:
  60. - auth
  61. summary: Logs out current logged in user session
  62. description: ""
  63. operationId: logoutUser
  64. produces:
  65. - application/json
  66. responses:
  67. default:
  68. description: successful operation
  69. security:
  70. - x-pasagi-session-token: []
  71. - x-pasagi-app-id: []
  72. - x-pasagi-dev-id: []
  73. - x-pasagi-usr-id: []
  74. - x-pasagi-cc: []
  75. - x-pasagi-dt: []
  76. - x-pasagi-st: []
  77. - x-pasagi-lat: []
  78. - x-pasagi-lon: []
  79. /users:
  80. post:
  81. tags:
  82. - user
  83. summary: Create user
  84. description: This can only be done by the logged in user with permission to create new user.
  85. operationId: createUser
  86. produces:
  87. - application/json
  88. parameters:
  89. - in: body
  90. name: body
  91. description: Created user object
  92. required: true
  93. schema:
  94. $ref: "#/definitions/NewUser"
  95. responses:
  96. default:
  97. description: successful operation
  98. /users/{username}:
  99. get:
  100. tags:
  101. - user
  102. summary: Get user by user name
  103. description: ""
  104. operationId: getUserByName
  105. produces:
  106. - application/json
  107. - application/xml
  108. parameters:
  109. - in: path
  110. name: username
  111. description: The name that needs to be fetched. Use user1 for testing.
  112. required: true
  113. type: string
  114. responses:
  115. "404":
  116. description: User not found
  117. "200":
  118. description: successful operation
  119. schema:
  120. $ref: "#/definitions/User"
  121. "400":
  122. description: Invalid username supplied
  123. put:
  124. tags:
  125. - user
  126. summary: Updated user
  127. description: This can only be done by the logged in user.
  128. operationId: updateUser
  129. produces:
  130. - application/json
  131. - application/xml
  132. parameters:
  133. - in: path
  134. name: username
  135. description: name that need to be deleted
  136. required: true
  137. type: string
  138. - in: body
  139. name: body
  140. description: Updated user object
  141. required: false
  142. schema:
  143. $ref: "#/definitions/User"
  144. responses:
  145. "404":
  146. description: User not found
  147. "400":
  148. description: Invalid user supplied
  149. delete:
  150. tags:
  151. - user
  152. summary: Delete user
  153. description: This can only be done by the logged in user.
  154. operationId: deleteUser
  155. produces:
  156. - application/json
  157. - application/xml
  158. parameters:
  159. - in: path
  160. name: username
  161. description: The name that needs to be deleted
  162. required: true
  163. type: string
  164. responses:
  165. "404":
  166. description: User not found
  167. "400":
  168. description: Invalid username supplied
  169. /stores/order:
  170. post:
  171. tags:
  172. - store
  173. summary: Place an order for a pet
  174. description: ""
  175. operationId: placeOrder
  176. produces:
  177. - application/json
  178. - application/xml
  179. parameters:
  180. - in: body
  181. name: body
  182. description: order placed for purchasing the pet
  183. required: false
  184. schema:
  185. $ref: "#/definitions/Order"
  186. responses:
  187. "200":
  188. description: successful operation
  189. schema:
  190. $ref: "#/definitions/Order"
  191. "400":
  192. description: Invalid Order
  193. /stores/order/{orderId}:
  194. get:
  195. tags:
  196. - store
  197. summary: Find purchase order by ID
  198. description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
  199. operationId: getOrderById
  200. produces:
  201. - application/json
  202. - application/xml
  203. parameters:
  204. - in: path
  205. name: orderId
  206. description: ID of pet that needs to be fetched
  207. required: true
  208. type: string
  209. responses:
  210. "404":
  211. description: Order not found
  212. "200":
  213. description: successful operation
  214. schema:
  215. $ref: "#/definitions/Order"
  216. "400":
  217. description: Invalid ID supplied
  218. delete:
  219. tags:
  220. - store
  221. summary: Delete purchase order by ID
  222. description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
  223. operationId: deleteOrder
  224. produces:
  225. - application/json
  226. - application/xml
  227. parameters:
  228. - in: path
  229. name: orderId
  230. description: ID of the order that needs to be deleted
  231. required: true
  232. type: string
  233. responses:
  234. "404":
  235. description: Order not found
  236. "400":
  237. description: Invalid ID supplied
  238. securityDefinitions:
  239. x-pasagi-app-id:
  240. type: apiKey
  241. name: x-pasagi-app-id
  242. in: header
  243. description: Registered Application ID
  244. x-pasagi-app-token:
  245. type: apiKey
  246. name: x-pasagi-app-token
  247. in: header
  248. description: Long lived token for Registered Application
  249. x-pasagi-dev-id:
  250. type: apiKey
  251. name: x-pasagi-dev-id
  252. in: header
  253. description: Device ID (MAC Address/ IMEI/ phone number/ ymid/ etc)
  254. x-pasagi-usr-id:
  255. type: apiKey
  256. name: x-pasagi-usr-id
  257. in: header
  258. description: User ID
  259. x-pasagi-session-token:
  260. type: apiKey
  261. name: x-pasagi-session-token
  262. in: header
  263. description: Short lived token from login, that's needed for other request
  264. x-pasagi-dt:
  265. type: apiKey
  266. name: x-pasagi-dt
  267. in: header
  268. description: timestamp
  269. x-pasagi-st:
  270. type: apiKey
  271. name: x-pasagi-st
  272. in: header
  273. description: System Trace Audit Number per request
  274. x-pasagi-cc:
  275. type: apiKey
  276. name: x-pasagi-cc
  277. in: header
  278. description: channel code (WEB/ MOBILE/ SMS/ H2H/ GTALK/ YM)
  279. x-pasagi-lat:
  280. type: apiKey
  281. name: x-pasagi-lat
  282. in: header
  283. description: Location Latitude
  284. x-pasagi-lon:
  285. type: apiKey
  286. name: x-pasagi-lon
  287. in: header
  288. description: Location Longitude
  289.  
  290. definitions:
  291. GenericUser:
  292. type: object
  293. properties:
  294. username:
  295. type: string
  296. firstName:
  297. type: string
  298. middleName:
  299. type: string
  300. lastName:
  301. type: string
  302. gender:
  303. type: string
  304. email:
  305. type: string
  306. NewUser:
  307. allOf:
  308. - $ref: "#/definitions/GenericUser"
  309. - type: object
  310. properties:
  311. password:
  312. type: string
  313. User:
  314. allOf:
  315. - $ref: "#/definitions/GenericUser"
  316. - type: object
  317. properties:
  318. id:
  319. type: integer
  320. format: int64
  321. userStatus:
  322. type: integer
  323. format: int32
  324. description: User Status
  325. Order:
  326. type: object
  327. properties:
  328. id:
  329. type: integer
  330. format: int64
  331. petId:
  332. type: integer
  333. format: int64
  334. quantity:
  335. type: integer
  336. format: int32
  337. shipDate:
  338. type: string
  339. format: date-time
  340. status:
  341. type: string
  342. description: Order Status
  343. complete:
  344. type: boolean
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement