Advertisement
Guest User

Untitled

a guest
Apr 1st, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.39 KB | None | 0 0
  1. #%RAML 0.8
  2. title: auth
  3. version: 1
  4.  
  5. baseUri: http://test.loc/api
  6. /user:
  7. /auth:
  8. post:
  9. description: User login
  10. responses:
  11. 200:
  12. body:
  13. application/json:
  14. example: |
  15. {
  16. "status":true,
  17. "message":"user was logged",
  18. "data":{
  19. "auth":{
  20. "token":"JwCNJilKCpCcYY6AN0IpYSVNgWwNLLo",
  21. "created_at":"2016-03-31 04:12:57",
  22. "expired_at":"2016-04-30 04:12:57"
  23. },
  24. "profile":{
  25. "disability":"hearing"
  26. }
  27. }
  28. }
  29. schema: |
  30. {
  31. "type": "object",
  32. "required": true,
  33. "properties": {
  34. "status": {
  35. "type": "boolean",
  36. "required": true
  37. },
  38. "message": {
  39. "type": "string",
  40. "required": true
  41. },
  42. "data": {
  43. "type": "object",
  44. "required": false,
  45. "properties": {
  46. "token": {
  47. "required": true,
  48. "type": "object",
  49. "properties": {
  50. "token": {
  51. "required": true,
  52. "type": "string"
  53. },
  54. "created_at": {
  55. "required": true,
  56. "type": "string"
  57. },
  58. "expired_at": {
  59. "required": false,
  60. "type": "string"
  61. }
  62. }
  63. },
  64. "auth":{
  65. "required": true,
  66. "type": "object",
  67. "properties": {
  68. "firstname": {
  69. "required": false,
  70. "type": "string"
  71. },
  72. "lastname": {
  73. "required": false,
  74. "type": "string"
  75. },
  76. "gender": {
  77. "required": false,
  78. "type": "int"
  79. },
  80. "dob": {
  81. "required": false,
  82. "decription": "date of birtday",
  83. "type": "string"
  84. },
  85. "profession_id": {
  86. "required": false,
  87. "type": "int"
  88. },
  89. "detailed_profession": {
  90. "required": false,
  91. "type": "string"
  92. },
  93. "country_id": {
  94. "required": false,
  95. "type": "int"
  96. },
  97. "city_id": {
  98. "required": false,
  99. "type": "int"
  100. },
  101. "detailed_city": {
  102. "required": false,
  103. "type": "string"
  104. },
  105. "url_photo": {
  106. "required": false,
  107. "type": "string"
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. 403:
  116. body:
  117. application/json:
  118. example: |
  119. {
  120. "status":false,
  121. "message":"user was not logged",
  122. "errors": {
  123. "username": ["Username cannot be blank."]
  124. }
  125. }
  126. schema: |
  127. {
  128. "type": "object",
  129. "required": true,
  130. "properties": {
  131. "status": {
  132. "type": "boolean",
  133. "required": true
  134. },
  135. "message": {
  136. "type": "string",
  137. "required": true
  138. },
  139. "errors": {
  140. "type": "object",
  141. "required": false,
  142. "properties": {
  143. "username": {
  144. "required": false,
  145. "type": "array"
  146. },
  147. "password": {
  148. "required": false,
  149. "type": "array"
  150. }
  151. }
  152. }
  153. }
  154. }
  155. 405:
  156. body:
  157. application/json:
  158. example: |
  159. {"status":false,"message":"invalid method"}
  160. queryParameters:
  161. username:
  162. required: true
  163. password:
  164. required: true
  165. /register:
  166. /index:
  167. post:
  168. description: registration
  169. responses:
  170. 200:
  171. body:
  172. application/json:
  173. example: |
  174. {"status":true,"message":"user was register and logged","data":{"auth":{"token":"n0D5RvwA7H1NLUX_CJbsN7ckMlX6wRwv","created_at":"2016-03-31 14:56:43","expired_at":"2016-04-30 14:56:43"},"profile":{"disability":"hearing"}}}
  175. schema: |
  176. {
  177. "type": "object",
  178. "required": true,
  179. "properties": {
  180. "status": {
  181. "type": "boolean",
  182. "required": true
  183. },
  184. "message": {
  185. "type": "string",
  186. "required": true
  187. },
  188. "data": {
  189. "type": "object",
  190. "required": false,
  191. "properties": {
  192. "token": {
  193. "required": true,
  194. "type": "object",
  195. "properties": {
  196. "token": {
  197. "required": true,
  198. "type": "string"
  199. },
  200. "created_at": {
  201. "required": true,
  202. "type": "string"
  203. },
  204. "expired_at": {
  205. "required": false,
  206. "type": "string"
  207. }
  208. }
  209. },
  210. "auth":{
  211. "required": true,
  212. "type": "object",
  213. "properties": {
  214. "firstname": {
  215. "required": false,
  216. "type": "string"
  217. },
  218. "lastname": {
  219. "required": false,
  220. "type": "string"
  221. },
  222. "gender": {
  223. "required": false,
  224. "type": "int"
  225. },
  226. "dob": {
  227. "required": false,
  228. "decription": "date of birtday",
  229. "type": "string"
  230. },
  231. "profession_id": {
  232. "required": false,
  233. "type": "int"
  234. },
  235. "detailed_profession": {
  236. "required": false,
  237. "type": "string"
  238. },
  239. "country_id": {
  240. "required": false,
  241. "type": "int"
  242. },
  243. "city_id": {
  244. "required": false,
  245. "type": "int"
  246. },
  247. "detailed_city": {
  248. "required": false,
  249. "type": "string"
  250. },
  251. "url_photo": {
  252. "required": false,
  253. "type": "string"
  254. }
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. 405:
  262. body:
  263. application/json:
  264. example: |
  265. {"status":false,"message":"invalid method"}
  266. 403:
  267. body:
  268. application/json:
  269. example: |
  270. {"status":false,"message":"user was register but not logged"}
  271. /check-username:
  272. get:
  273. description: check username
  274. responses:
  275. 200:
  276. body:
  277. application/json:
  278. example: |
  279. {
  280. "status":true,
  281. "message":"username status",
  282. "data":{
  283. "username":"235fdgh237",
  284. "exists":true
  285. }
  286. }
  287. schema: |
  288. {
  289. "type": "object",
  290. "required": true,Улица Монстро, 10
  291. "properties": {
  292. "status": {
  293. "type": "boolean",
  294. "required": true
  295. },
  296. "message": {
  297. "type": "string",
  298. "required": true
  299. },
  300. "data": {
  301. "type": "object",
  302. "required": true,
  303. "properties": {
  304. "username": {
  305. "required": true,
  306. "type": "string"
  307. },
  308. "exists": {
  309. "required": true,
  310. "type": "boolean"
  311. }
  312. }
  313. }
  314. }
  315. }
  316. 405:
  317. body:
  318. application/json:
  319. example: |
  320. {"status":false,"message":"invalid method"}
  321. queryParameters:
  322. username:
  323. required: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement