1
0

api_data.js 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460
  1. define({ "api": [
  2. {
  3. "type": "post",
  4. "url": "/accounts",
  5. "title": "Create account",
  6. "version": "1.0.0",
  7. "name": "Create_account",
  8. "group": "Accounts",
  9. "parameter": {
  10. "fields": {
  11. "Parameter": [
  12. {
  13. "group": "Parameter",
  14. "type": "<p>String</p> ",
  15. "optional": false,
  16. "field": "name",
  17. "description": "<p>Name for the new account</p> "
  18. },
  19. {
  20. "group": "Parameter",
  21. "type": "<p>String</p> ",
  22. "optional": false,
  23. "field": "reference",
  24. "description": "<p>A reference (bank account number) for the new account</p> "
  25. }
  26. ]
  27. },
  28. "examples": [
  29. {
  30. "title": "Request-Example: ",
  31. "content": "{\n name: 'Home',\n reference: '1234567890'\n}",
  32. "type": "json"
  33. }
  34. ]
  35. },
  36. "header": {
  37. "fields": {
  38. "Header": [
  39. {
  40. "group": "Header",
  41. "type": "String",
  42. "optional": false,
  43. "field": "Content-Type",
  44. "description": "<p>application/json</p> "
  45. },
  46. {
  47. "group": "Header",
  48. "type": "String",
  49. "optional": false,
  50. "field": "Authorization",
  51. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  52. }
  53. ]
  54. },
  55. "examples": [
  56. {
  57. "title": "Authorization header example:",
  58. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  59. "type": "string"
  60. }
  61. ]
  62. },
  63. "error": {
  64. "fields": {
  65. "400": [
  66. {
  67. "group": "400",
  68. "type": "<p>json</p> ",
  69. "optional": false,
  70. "field": "BadRequest",
  71. "description": "<p>The user can't be found.</p> "
  72. }
  73. ],
  74. "401": [
  75. {
  76. "group": "401",
  77. "type": "<p>json</p> ",
  78. "optional": false,
  79. "field": "AuthenticationFailed",
  80. "description": "<p>The user can't be found.</p> "
  81. }
  82. ]
  83. },
  84. "examples": [
  85. {
  86. "title": "AuthenticationFailed:",
  87. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  88. "type": "json"
  89. },
  90. {
  91. "title": "BadRequest:",
  92. "content": "HTTP/1.1 400 Bad Request\n [\n {\n \"field\": \"name\",\n \"rule\": \"required\",\n \"message\": \"Path `name` is required.\"\n }\n ]",
  93. "type": "json"
  94. }
  95. ]
  96. },
  97. "success": {
  98. "fields": {
  99. "201": [
  100. {
  101. "group": "201",
  102. "type": "<p>Object</p> ",
  103. "optional": false,
  104. "field": "account",
  105. "description": "<p>The new account with its (sub)categories.</p> "
  106. }
  107. ]
  108. },
  109. "examples": [
  110. {
  111. "title": "Success-Response:",
  112. "content": "HTTP/1.1 201 Created\n {\n \"name\": \"Home\",\n \"reference\": \"1234567890\",\n \"user_id\": \"55e6e4e005230f49271c7078\",\n \"_id\": \"55e8218912c65a1730c34858\",\n \"created_at\": \"2015-09-03T10:31:37.889Z\",\n \"categories\": [\n {\n \"key\": \"alimony_payments\",\n \"label\": \"Alimony Payments\",\n \"_id\": \"55e8218912c65a1730c34859\",\n \"sub_categories\": []\n },\n {\n \"key\": \"automobile_expenses\",\n \"label\": \"Automobile Expenses\",\n \"_id\": \"55e8218912c65a1730c3485a\",\n \"sub_categories\": [\n {\n \"label\": \"Car Payment\",\n \"key\": \"car_payment\",\n \"_id\": \"55e8218912c65a1730c3485d\"\n }\n ]\n }\n ]\n }",
  113. "type": "json"
  114. }
  115. ]
  116. },
  117. "filename": "app/routes/accounts.js",
  118. "groupTitle": "Accounts"
  119. },
  120. {
  121. "type": "delete",
  122. "url": "/accounts/:account_id",
  123. "title": "Delete account",
  124. "version": "1.0.0",
  125. "name": "Delete_account",
  126. "group": "Accounts",
  127. "parameter": {
  128. "fields": {
  129. "Parameter": [
  130. {
  131. "group": "Parameter",
  132. "type": "<p>String</p> ",
  133. "optional": false,
  134. "field": "account_id",
  135. "description": "<p>The account to delete</p> "
  136. }
  137. ]
  138. }
  139. },
  140. "header": {
  141. "fields": {
  142. "Header": [
  143. {
  144. "group": "Header",
  145. "type": "String",
  146. "optional": false,
  147. "field": "Authorization",
  148. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  149. }
  150. ]
  151. },
  152. "examples": [
  153. {
  154. "title": "Authorization header example:",
  155. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  156. "type": "string"
  157. }
  158. ]
  159. },
  160. "error": {
  161. "fields": {
  162. "401": [
  163. {
  164. "group": "401",
  165. "type": "<p>json</p> ",
  166. "optional": false,
  167. "field": "AuthenticationFailed",
  168. "description": "<p>The user can't be found.</p> "
  169. }
  170. ],
  171. "404": [
  172. {
  173. "group": "404",
  174. "type": "<p>json</p> ",
  175. "optional": false,
  176. "field": "AccountNotFound",
  177. "description": "<p>The account can't be found.</p> "
  178. }
  179. ]
  180. },
  181. "examples": [
  182. {
  183. "title": "AuthenticationFailed:",
  184. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  185. "type": "json"
  186. },
  187. {
  188. "title": "AccountNotFound:",
  189. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  190. "type": "json"
  191. }
  192. ]
  193. },
  194. "success": {
  195. "fields": {
  196. "204": [
  197. {
  198. "group": "204",
  199. "optional": false,
  200. "field": "-",
  201. "description": ""
  202. }
  203. ]
  204. },
  205. "examples": [
  206. {
  207. "title": "Success-Response:",
  208. "content": "HTTP/1.1 204 No Content",
  209. "type": "json"
  210. }
  211. ]
  212. },
  213. "filename": "app/routes/accounts.js",
  214. "groupTitle": "Accounts"
  215. },
  216. {
  217. "type": "get",
  218. "url": "/accounts/:account_id",
  219. "title": "Get account",
  220. "version": "1.0.0",
  221. "name": "Get_account",
  222. "group": "Accounts",
  223. "parameter": {
  224. "fields": {
  225. "Parameter": [
  226. {
  227. "group": "Parameter",
  228. "type": "<p>String</p> ",
  229. "optional": false,
  230. "field": "account_id",
  231. "description": "<p>The given account</p> "
  232. }
  233. ]
  234. }
  235. },
  236. "header": {
  237. "fields": {
  238. "Header": [
  239. {
  240. "group": "Header",
  241. "type": "String",
  242. "optional": false,
  243. "field": "Content-Type",
  244. "description": "<p>application/json</p> "
  245. },
  246. {
  247. "group": "Header",
  248. "type": "String",
  249. "optional": false,
  250. "field": "Authorization",
  251. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  252. }
  253. ]
  254. },
  255. "examples": [
  256. {
  257. "title": "Authorization header example:",
  258. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  259. "type": "string"
  260. }
  261. ]
  262. },
  263. "error": {
  264. "fields": {
  265. "401": [
  266. {
  267. "group": "401",
  268. "type": "<p>json</p> ",
  269. "optional": false,
  270. "field": "AuthenticationFailed",
  271. "description": "<p>The user can't be found.</p> "
  272. }
  273. ],
  274. "404": [
  275. {
  276. "group": "404",
  277. "type": "<p>json</p> ",
  278. "optional": false,
  279. "field": "AccountNotFound",
  280. "description": "<p>The account can't be found.</p> "
  281. }
  282. ]
  283. },
  284. "examples": [
  285. {
  286. "title": "AuthenticationFailed:",
  287. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  288. "type": "json"
  289. },
  290. {
  291. "title": "AccountNotFound:",
  292. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  293. "type": "json"
  294. }
  295. ]
  296. },
  297. "success": {
  298. "fields": {
  299. "200": [
  300. {
  301. "group": "200",
  302. "type": "<p>Object</p> ",
  303. "optional": false,
  304. "field": "account",
  305. "description": "<p>The account with its (sub)categories.</p> "
  306. }
  307. ]
  308. },
  309. "examples": [
  310. {
  311. "title": "Success-Response:",
  312. "content": "HTTP/1.1 200 OK\n {\n \"name\": \"Home\",\n \"reference\": \"1234567890\",\n \"user_id\": \"55e6e4e005230f49271c7078\",\n \"_id\": \"55e8218912c65a1730c34858\",\n \"created_at\": \"2015-09-03T10:31:37.889Z\",\n \"categories\": [\n {\n \"key\": \"alimony_payments\",\n \"label\": \"Alimony Payments\",\n \"_id\": \"55e8218912c65a1730c34859\",\n \"sub_categories\": []\n },\n {\n \"key\": \"automobile_expenses\",\n \"label\": \"Automobile Expenses\",\n \"_id\": \"55e8218912c65a1730c3485a\",\n \"sub_categories\": [\n {\n \"label\": \"Car Payment\",\n \"key\": \"car_payment\",\n \"_id\": \"55e8218912c65a1730c3485d\"\n }\n ]\n }\n ]\n }",
  313. "type": "json"
  314. }
  315. ]
  316. },
  317. "filename": "app/routes/accounts.js",
  318. "groupTitle": "Accounts"
  319. },
  320. {
  321. "type": "put",
  322. "url": "/accounts/:account_id",
  323. "title": "Modify account",
  324. "version": "1.0.0",
  325. "name": "Modify_account",
  326. "group": "Accounts",
  327. "parameter": {
  328. "fields": {
  329. "Parameter": [
  330. {
  331. "group": "Parameter",
  332. "type": "<p>String</p> ",
  333. "optional": false,
  334. "field": "account_id",
  335. "description": "<p>The account id to modify</p> "
  336. },
  337. {
  338. "group": "Parameter",
  339. "type": "<p>String</p> ",
  340. "optional": false,
  341. "field": "name",
  342. "description": "<p>Name for the new account</p> "
  343. },
  344. {
  345. "group": "Parameter",
  346. "type": "<p>String</p> ",
  347. "optional": false,
  348. "field": "reference",
  349. "description": "<p>A reference (bank account number) for the new account</p> "
  350. }
  351. ]
  352. },
  353. "examples": [
  354. {
  355. "title": "Request-Example: ",
  356. "content": "{\n name: 'Home',\n reference: '1234567890'\n}",
  357. "type": "json"
  358. }
  359. ]
  360. },
  361. "header": {
  362. "fields": {
  363. "Header": [
  364. {
  365. "group": "Header",
  366. "type": "String",
  367. "optional": false,
  368. "field": "Content-Type",
  369. "description": "<p>application/json</p> "
  370. },
  371. {
  372. "group": "Header",
  373. "type": "String",
  374. "optional": false,
  375. "field": "Authorization",
  376. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  377. }
  378. ]
  379. },
  380. "examples": [
  381. {
  382. "title": "Authorization header example:",
  383. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  384. "type": "string"
  385. }
  386. ]
  387. },
  388. "error": {
  389. "fields": {
  390. "400": [
  391. {
  392. "group": "400",
  393. "type": "<p>json</p> ",
  394. "optional": false,
  395. "field": "BadRequest",
  396. "description": "<p>The user can't be found.</p> "
  397. }
  398. ],
  399. "401": [
  400. {
  401. "group": "401",
  402. "type": "<p>json</p> ",
  403. "optional": false,
  404. "field": "AuthenticationFailed",
  405. "description": "<p>The user can't be found.</p> "
  406. }
  407. ],
  408. "404": [
  409. {
  410. "group": "404",
  411. "type": "<p>json</p> ",
  412. "optional": false,
  413. "field": "AccountNotFound",
  414. "description": "<p>The account can't be found.</p> "
  415. }
  416. ]
  417. },
  418. "examples": [
  419. {
  420. "title": "AuthenticationFailed:",
  421. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  422. "type": "json"
  423. },
  424. {
  425. "title": "BadRequest:",
  426. "content": "HTTP/1.1 400 Bad Request\n [\n {\n \"field\": \"name\",\n \"rule\": \"required\",\n \"message\": \"Path `name` is required.\"\n }\n ]",
  427. "type": "json"
  428. },
  429. {
  430. "title": "AccountNotFound:",
  431. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  432. "type": "json"
  433. }
  434. ]
  435. },
  436. "success": {
  437. "fields": {
  438. "Success 200": [
  439. {
  440. "group": "Success 200",
  441. "type": "<p>String</p> ",
  442. "optional": false,
  443. "field": "username",
  444. "description": "<p>Username of the User.</p> "
  445. },
  446. {
  447. "group": "Success 200",
  448. "type": "<p>String</p> ",
  449. "optional": false,
  450. "field": "token",
  451. "description": "<p>The JWT valid token.</p> "
  452. }
  453. ]
  454. },
  455. "examples": [
  456. {
  457. "title": "Success-Response:",
  458. "content": "HTTP/1.1 200 OK\n {\n \"name\": \"Home\",\n \"reference\": \"1234567890\",\n \"user_id\": \"55e6e4e005230f49271c7078\",\n \"_id\": \"55e8218912c65a1730c34858\",\n \"created_at\": \"2015-09-03T10:31:37.889Z\",\n \"categories\": [\n {\n \"key\": \"alimony_payments\",\n \"label\": \"Alimony Payments\",\n \"_id\": \"55e8218912c65a1730c34859\",\n \"sub_categories\": []\n },\n {\n \"key\": \"automobile_expenses\",\n \"label\": \"Automobile Expenses\",\n \"_id\": \"55e8218912c65a1730c3485a\",\n \"sub_categories\": [\n {\n \"label\": \"Car Payment\",\n \"key\": \"car_payment\",\n \"_id\": \"55e8218912c65a1730c3485d\"\n }\n ]\n }\n ]\n }",
  459. "type": "json"
  460. }
  461. ]
  462. },
  463. "filename": "app/routes/accounts.js",
  464. "groupTitle": "Accounts"
  465. },
  466. {
  467. "type": "get",
  468. "url": "/accounts",
  469. "title": "List accounts",
  470. "version": "1.0.0",
  471. "name": "Retrieve_accounts",
  472. "group": "Accounts",
  473. "header": {
  474. "fields": {
  475. "Header": [
  476. {
  477. "group": "Header",
  478. "type": "String",
  479. "optional": false,
  480. "field": "Content-Type",
  481. "description": "<p>application/json</p> "
  482. },
  483. {
  484. "group": "Header",
  485. "type": "String",
  486. "optional": false,
  487. "field": "Authorization",
  488. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  489. }
  490. ]
  491. },
  492. "examples": [
  493. {
  494. "title": "Authorization header example:",
  495. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  496. "type": "string"
  497. }
  498. ]
  499. },
  500. "error": {
  501. "fields": {
  502. "401": [
  503. {
  504. "group": "401",
  505. "type": "<p>json</p> ",
  506. "optional": false,
  507. "field": "AuthenticationFailed",
  508. "description": "<p>The user can't be found.</p> "
  509. }
  510. ]
  511. },
  512. "examples": [
  513. {
  514. "title": "AuthenticationFailed:",
  515. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  516. "type": "json"
  517. }
  518. ]
  519. },
  520. "success": {
  521. "fields": {
  522. "200": [
  523. {
  524. "group": "200",
  525. "type": "<p>json</p> ",
  526. "optional": false,
  527. "field": "accounts",
  528. "description": "<p>List of all accounts and their (sub)categories.</p> "
  529. }
  530. ]
  531. },
  532. "examples": [
  533. {
  534. "title": "Success-Response:",
  535. "content": "HTTP/1.1 200 OK\n [{\n \"name\": \"Home\",\n \"reference\": \"1234567890\",\n \"user_id\": \"55e6e4e005230f49271c7078\",\n \"_id\": \"55e8218912c65a1730c34858\",\n \"created_at\": \"2015-09-03T10:31:37.889Z\",\n \"categories\": [\n {\n \"key\": \"alimony_payments\",\n \"label\": \"Alimony Payments\",\n \"_id\": \"55e8218912c65a1730c34859\",\n \"sub_categories\": []\n },\n {\n \"key\": \"automobile_expenses\",\n \"label\": \"Automobile Expenses\",\n \"_id\": \"55e8218912c65a1730c3485a\",\n \"sub_categories\": [\n {\n \"label\": \"Car Payment\",\n \"key\": \"car_payment\",\n \"_id\": \"55e8218912c65a1730c3485d\"\n }\n ]\n }\n ]\n }]",
  536. "type": "json"
  537. }
  538. ]
  539. },
  540. "filename": "app/routes/accounts.js",
  541. "groupTitle": "Accounts"
  542. },
  543. {
  544. "type": "post",
  545. "url": "/accounts/:account_id/entries",
  546. "title": "Create entry",
  547. "version": "1.0.0",
  548. "name": "Create_entry",
  549. "group": "Entries",
  550. "parameter": {
  551. "fields": {
  552. "Parameter": [
  553. {
  554. "group": "Parameter",
  555. "type": "<p>String</p> ",
  556. "optional": false,
  557. "field": "account_id",
  558. "description": "<p>The account id to populate</p> "
  559. },
  560. {
  561. "group": "Parameter",
  562. "type": "<p>String</p> ",
  563. "optional": false,
  564. "field": "amount",
  565. "description": "<p>Amount of the entry</p> "
  566. },
  567. {
  568. "group": "Parameter",
  569. "type": "<p>String</p> ",
  570. "optional": false,
  571. "field": "date",
  572. "description": "<p>Date of the bill/deposit</p> "
  573. },
  574. {
  575. "group": "Parameter",
  576. "type": "<p>String</p> ",
  577. "optional": true,
  578. "field": "category",
  579. "description": "<p>Category id of the bill/deposit</p> "
  580. },
  581. {
  582. "group": "Parameter",
  583. "type": "<p>String</p> ",
  584. "optional": true,
  585. "field": "sub_category",
  586. "description": "<p>Sub category id of the bill/deposit</p> "
  587. },
  588. {
  589. "group": "Parameter",
  590. "type": "<p>String</p> ",
  591. "optional": true,
  592. "field": "label",
  593. "description": "<p>A label for the entry</p> "
  594. }
  595. ]
  596. },
  597. "examples": [
  598. {
  599. "title": "Request-Example: ",
  600. "content": "{\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n}",
  601. "type": "json"
  602. }
  603. ]
  604. },
  605. "header": {
  606. "fields": {
  607. "Header": [
  608. {
  609. "group": "Header",
  610. "type": "String",
  611. "optional": false,
  612. "field": "Content-Type",
  613. "description": "<p>application/json</p> "
  614. },
  615. {
  616. "group": "Header",
  617. "type": "String",
  618. "optional": false,
  619. "field": "Authorization",
  620. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  621. }
  622. ]
  623. },
  624. "examples": [
  625. {
  626. "title": "Authorization header example:",
  627. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  628. "type": "string"
  629. }
  630. ]
  631. },
  632. "error": {
  633. "fields": {
  634. "400": [
  635. {
  636. "group": "400",
  637. "type": "<p>json</p> ",
  638. "optional": false,
  639. "field": "BadRequest",
  640. "description": "<p>The user can't be found.</p> "
  641. }
  642. ],
  643. "401": [
  644. {
  645. "group": "401",
  646. "type": "<p>json</p> ",
  647. "optional": false,
  648. "field": "AuthenticationFailed",
  649. "description": "<p>The user can't be found.</p> "
  650. }
  651. ],
  652. "404": [
  653. {
  654. "group": "404",
  655. "type": "<p>json</p> ",
  656. "optional": false,
  657. "field": "AccountNotFound",
  658. "description": "<p>The account can't be found.</p> "
  659. }
  660. ]
  661. },
  662. "examples": [
  663. {
  664. "title": "AuthenticationFailed:",
  665. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  666. "type": "json"
  667. },
  668. {
  669. "title": "BadRequest:",
  670. "content": "HTTP/1.1 400 Bad Request\n [\n {\n \"field\": \"amount\",\n \"rule\": \"required\",\n \"message\": \"Path `amount` is required.\"\n }\n ]",
  671. "type": "json"
  672. },
  673. {
  674. "title": "AccountNotFound:",
  675. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  676. "type": "json"
  677. }
  678. ]
  679. },
  680. "success": {
  681. "fields": {
  682. "201": [
  683. {
  684. "group": "201",
  685. "type": "<p>Object</p> ",
  686. "optional": false,
  687. "field": "entry",
  688. "description": "<p>The created entry.</p> "
  689. },
  690. {
  691. "group": "201",
  692. "type": "<p>Object[]</p> ",
  693. "optional": false,
  694. "field": "entries",
  695. "description": "<p>All account's entries</p> "
  696. },
  697. {
  698. "group": "201",
  699. "type": "<p>Number</p> ",
  700. "optional": false,
  701. "field": "balance",
  702. "description": "<p>The account's total balance</p> "
  703. }
  704. ]
  705. },
  706. "examples": [
  707. {
  708. "title": "Success-Response:",
  709. "content": " HTTP/1.1 201 Created\n{\n entry: {\n _id: '',\n account_id: '1000',\n type: 'DEPOSIT'\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n },\n entries: [\n {\n _id: '',\n account_id: '1000',\n type: 'DEPOSIT'\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n }\n ],\n balance: 1000\n}",
  710. "type": "json"
  711. }
  712. ]
  713. },
  714. "filename": "app/routes/accounts.js",
  715. "groupTitle": "Entries"
  716. },
  717. {
  718. "type": "delete",
  719. "url": "/accounts/:account_id/entries/:entry_id",
  720. "title": "Delete entry",
  721. "version": "1.0.0",
  722. "name": "Delete_entry",
  723. "group": "Entries",
  724. "parameter": {
  725. "fields": {
  726. "Parameter": [
  727. {
  728. "group": "Parameter",
  729. "type": "<p>String</p> ",
  730. "optional": false,
  731. "field": "account_id",
  732. "description": "<p>The owner account</p> "
  733. },
  734. {
  735. "group": "Parameter",
  736. "type": "<p>String</p> ",
  737. "optional": false,
  738. "field": "entry_id",
  739. "description": "<p>The entry to delete</p> "
  740. }
  741. ]
  742. }
  743. },
  744. "header": {
  745. "fields": {
  746. "Header": [
  747. {
  748. "group": "Header",
  749. "type": "String",
  750. "optional": false,
  751. "field": "Authorization",
  752. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  753. }
  754. ]
  755. },
  756. "examples": [
  757. {
  758. "title": "Authorization header example:",
  759. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  760. "type": "string"
  761. }
  762. ]
  763. },
  764. "error": {
  765. "fields": {
  766. "401": [
  767. {
  768. "group": "401",
  769. "type": "<p>json</p> ",
  770. "optional": false,
  771. "field": "AuthenticationFailed",
  772. "description": "<p>The user can't be found.</p> "
  773. }
  774. ],
  775. "404": [
  776. {
  777. "group": "404",
  778. "type": "<p>json</p> ",
  779. "optional": false,
  780. "field": "AccountNotFound",
  781. "description": "<p>The account can't be found.</p> "
  782. },
  783. {
  784. "group": "404",
  785. "type": "<p>json</p> ",
  786. "optional": false,
  787. "field": "EntryNotFound",
  788. "description": "<p>The entry can't be found.</p> "
  789. }
  790. ]
  791. },
  792. "examples": [
  793. {
  794. "title": "AuthenticationFailed:",
  795. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  796. "type": "json"
  797. },
  798. {
  799. "title": "AccountNotFound:",
  800. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  801. "type": "json"
  802. },
  803. {
  804. "title": "AccountNotFound:",
  805. "content": "HTTP/1.1 404 Not Found",
  806. "type": "json"
  807. }
  808. ]
  809. },
  810. "success": {
  811. "fields": {
  812. "204": [
  813. {
  814. "group": "204",
  815. "optional": false,
  816. "field": "-",
  817. "description": ""
  818. }
  819. ]
  820. },
  821. "examples": [
  822. {
  823. "title": "Success-Response:",
  824. "content": "HTTP/1.1 204 No Content",
  825. "type": "json"
  826. }
  827. ]
  828. },
  829. "filename": "app/routes/accounts.js",
  830. "groupTitle": "Entries"
  831. },
  832. {
  833. "type": "get",
  834. "url": "/accounts/:account_id/entries",
  835. "title": "List account entries",
  836. "version": "1.0.0",
  837. "name": "List_entries",
  838. "group": "Entries",
  839. "parameter": {
  840. "fields": {
  841. "Parameter": [
  842. {
  843. "group": "Parameter",
  844. "type": "<p>String</p> ",
  845. "optional": false,
  846. "field": "account_id",
  847. "description": "<p>The account id to retrieve</p> "
  848. }
  849. ]
  850. }
  851. },
  852. "header": {
  853. "fields": {
  854. "Header": [
  855. {
  856. "group": "Header",
  857. "type": "String",
  858. "optional": false,
  859. "field": "Content-Type",
  860. "description": "<p>application/json</p> "
  861. },
  862. {
  863. "group": "Header",
  864. "type": "String",
  865. "optional": false,
  866. "field": "Authorization",
  867. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  868. }
  869. ]
  870. },
  871. "examples": [
  872. {
  873. "title": "Authorization header example:",
  874. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  875. "type": "string"
  876. }
  877. ]
  878. },
  879. "error": {
  880. "fields": {
  881. "401": [
  882. {
  883. "group": "401",
  884. "type": "<p>json</p> ",
  885. "optional": false,
  886. "field": "AuthenticationFailed",
  887. "description": "<p>The user can't be found.</p> "
  888. }
  889. ],
  890. "404": [
  891. {
  892. "group": "404",
  893. "type": "<p>json</p> ",
  894. "optional": false,
  895. "field": "AccountNotFound",
  896. "description": "<p>The account can't be found.</p> "
  897. }
  898. ]
  899. },
  900. "examples": [
  901. {
  902. "title": "AuthenticationFailed:",
  903. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  904. "type": "json"
  905. },
  906. {
  907. "title": "AccountNotFound:",
  908. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  909. "type": "json"
  910. }
  911. ]
  912. },
  913. "success": {
  914. "fields": {
  915. "200": [
  916. {
  917. "group": "200",
  918. "type": "<p>json</p> ",
  919. "optional": false,
  920. "field": "entries",
  921. "description": "<p>List of all account entries.</p> "
  922. }
  923. ]
  924. },
  925. "examples": [
  926. {
  927. "title": "Success-Response:",
  928. "content": "HTTP/1.1 200 OK\n [\n {\n _id: '',\n account_id: '1000',\n type: 'DEPOSIT'\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n }\n ]",
  929. "type": "json"
  930. }
  931. ]
  932. },
  933. "filename": "app/routes/accounts.js",
  934. "groupTitle": "Entries"
  935. },
  936. {
  937. "type": "post",
  938. "url": "/accounts/:account_id/entries/:entry_id",
  939. "title": "Modify entry",
  940. "version": "1.0.0",
  941. "name": "Modify_entry",
  942. "group": "Entries",
  943. "parameter": {
  944. "fields": {
  945. "Parameter": [
  946. {
  947. "group": "Parameter",
  948. "type": "<p>String</p> ",
  949. "optional": false,
  950. "field": "account_id",
  951. "description": "<p>The owner account</p> "
  952. },
  953. {
  954. "group": "Parameter",
  955. "type": "<p>String</p> ",
  956. "optional": false,
  957. "field": "entry_id",
  958. "description": "<p>The entry to modify</p> "
  959. },
  960. {
  961. "group": "Parameter",
  962. "type": "<p>String</p> ",
  963. "optional": false,
  964. "field": "amount",
  965. "description": "<p>Amount of the entry</p> "
  966. },
  967. {
  968. "group": "Parameter",
  969. "type": "<p>String</p> ",
  970. "optional": false,
  971. "field": "date",
  972. "description": "<p>Date of the bill/deposit</p> "
  973. },
  974. {
  975. "group": "Parameter",
  976. "type": "<p>String</p> ",
  977. "optional": true,
  978. "field": "category",
  979. "description": "<p>Category id of the bill/deposit</p> "
  980. },
  981. {
  982. "group": "Parameter",
  983. "type": "<p>String</p> ",
  984. "optional": true,
  985. "field": "sub_category",
  986. "description": "<p>Sub category id of the bill/deposit</p> "
  987. },
  988. {
  989. "group": "Parameter",
  990. "type": "<p>String</p> ",
  991. "optional": true,
  992. "field": "label",
  993. "description": "<p>A label for the entry</p> "
  994. }
  995. ]
  996. },
  997. "examples": [
  998. {
  999. "title": "Request-Example: ",
  1000. "content": "{\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n}",
  1001. "type": "json"
  1002. }
  1003. ]
  1004. },
  1005. "header": {
  1006. "fields": {
  1007. "Header": [
  1008. {
  1009. "group": "Header",
  1010. "type": "String",
  1011. "optional": false,
  1012. "field": "Content-Type",
  1013. "description": "<p>application/json</p> "
  1014. },
  1015. {
  1016. "group": "Header",
  1017. "type": "String",
  1018. "optional": false,
  1019. "field": "Authorization",
  1020. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  1021. }
  1022. ]
  1023. },
  1024. "examples": [
  1025. {
  1026. "title": "Authorization header example:",
  1027. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  1028. "type": "string"
  1029. }
  1030. ]
  1031. },
  1032. "error": {
  1033. "fields": {
  1034. "400": [
  1035. {
  1036. "group": "400",
  1037. "type": "<p>json</p> ",
  1038. "optional": false,
  1039. "field": "BadRequest",
  1040. "description": "<p>The user can't be found.</p> "
  1041. }
  1042. ],
  1043. "401": [
  1044. {
  1045. "group": "401",
  1046. "type": "<p>json</p> ",
  1047. "optional": false,
  1048. "field": "AuthenticationFailed",
  1049. "description": "<p>The user can't be found.</p> "
  1050. }
  1051. ],
  1052. "404": [
  1053. {
  1054. "group": "404",
  1055. "type": "<p>json</p> ",
  1056. "optional": false,
  1057. "field": "AccountNotFound",
  1058. "description": "<p>The account can't be found.</p> "
  1059. },
  1060. {
  1061. "group": "404",
  1062. "type": "<p>json</p> ",
  1063. "optional": false,
  1064. "field": "EntryNotFound",
  1065. "description": "<p>The entry can't be found.</p> "
  1066. }
  1067. ]
  1068. },
  1069. "examples": [
  1070. {
  1071. "title": "AuthenticationFailed:",
  1072. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  1073. "type": "json"
  1074. },
  1075. {
  1076. "title": "BadRequest:",
  1077. "content": "HTTP/1.1 400 Bad Request\n [\n {\n \"field\": \"amount\",\n \"rule\": \"required\",\n \"message\": \"Path `amount` is required.\"\n }\n ]",
  1078. "type": "json"
  1079. },
  1080. {
  1081. "title": "AccountNotFound:",
  1082. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  1083. "type": "json"
  1084. },
  1085. {
  1086. "title": "AccountNotFound:",
  1087. "content": "HTTP/1.1 404 Not Found",
  1088. "type": "json"
  1089. }
  1090. ]
  1091. },
  1092. "success": {
  1093. "fields": {
  1094. "200": [
  1095. {
  1096. "group": "200",
  1097. "type": "<p>Object</p> ",
  1098. "optional": false,
  1099. "field": "entry",
  1100. "description": "<p>The created entry.</p> "
  1101. },
  1102. {
  1103. "group": "200",
  1104. "type": "<p>Object[]</p> ",
  1105. "optional": false,
  1106. "field": "entries",
  1107. "description": "<p>All account's entries</p> "
  1108. },
  1109. {
  1110. "group": "200",
  1111. "type": "<p>Number</p> ",
  1112. "optional": false,
  1113. "field": "balance",
  1114. "description": "<p>The account's total balance</p> "
  1115. }
  1116. ]
  1117. },
  1118. "examples": [
  1119. {
  1120. "title": "Success-Response:",
  1121. "content": " HTTP/1.1 200 OK\n{\n entry: {\n _id: '',\n account_id: '1000',\n type: 'DEPOSIT'\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n },\n entries: [\n {\n _id: '',\n account_id: '1000',\n type: 'DEPOSIT'\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n }\n ],\n balance: 1000\n}",
  1122. "type": "json"
  1123. }
  1124. ]
  1125. },
  1126. "filename": "app/routes/accounts.js",
  1127. "groupTitle": "Entries"
  1128. },
  1129. {
  1130. "type": "post",
  1131. "url": "/users/login",
  1132. "title": "Login",
  1133. "version": "1.0.0",
  1134. "name": "Login",
  1135. "group": "Users",
  1136. "header": {
  1137. "fields": {
  1138. "Header": [
  1139. {
  1140. "group": "Header",
  1141. "type": "String",
  1142. "optional": false,
  1143. "field": "Content-Type",
  1144. "description": "<p>application/json</p> "
  1145. }
  1146. ]
  1147. }
  1148. },
  1149. "parameter": {
  1150. "fields": {
  1151. "Parameter": [
  1152. {
  1153. "group": "Parameter",
  1154. "type": "<p>String</p> ",
  1155. "optional": false,
  1156. "field": "username",
  1157. "description": "<p>User's username</p> "
  1158. },
  1159. {
  1160. "group": "Parameter",
  1161. "type": "<p>String</p> ",
  1162. "optional": false,
  1163. "field": "password",
  1164. "description": "<p>User's password</p> "
  1165. }
  1166. ]
  1167. },
  1168. "examples": [
  1169. {
  1170. "title": "Request-Example: ",
  1171. "content": "{ \n \"username\": \"John\", \n \"password\": \"s3cr3t\" \n}",
  1172. "type": "json"
  1173. }
  1174. ]
  1175. },
  1176. "success": {
  1177. "fields": {
  1178. "Success 200": [
  1179. {
  1180. "group": "Success 200",
  1181. "type": "<p>String</p> ",
  1182. "optional": false,
  1183. "field": "username",
  1184. "description": "<p>Username of the User.</p> "
  1185. },
  1186. {
  1187. "group": "Success 200",
  1188. "type": "<p>String</p> ",
  1189. "optional": false,
  1190. "field": "token",
  1191. "description": "<p>The JWT valid token.</p> "
  1192. }
  1193. ]
  1194. },
  1195. "examples": [
  1196. {
  1197. "title": "Success-Response:",
  1198. "content": "HTTP/1.1 200 OK\n{\n \"username\": \"John\",\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"\n}",
  1199. "type": "json"
  1200. }
  1201. ]
  1202. },
  1203. "error": {
  1204. "fields": {
  1205. "401": [
  1206. {
  1207. "group": "401",
  1208. "type": "<p>json</p> ",
  1209. "optional": false,
  1210. "field": "AuthenticationFailed",
  1211. "description": "<p>The user can't be found.</p> "
  1212. }
  1213. ]
  1214. },
  1215. "examples": [
  1216. {
  1217. "title": "AuthenticationFailed:",
  1218. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  1219. "type": "json"
  1220. }
  1221. ]
  1222. },
  1223. "filename": "app/routes/users.js",
  1224. "groupTitle": "Users"
  1225. },
  1226. {
  1227. "type": "delete",
  1228. "url": "/users/login",
  1229. "title": "Logout",
  1230. "version": "1.0.0",
  1231. "name": "Logout",
  1232. "group": "Users",
  1233. "header": {
  1234. "fields": {
  1235. "Header": [
  1236. {
  1237. "group": "Header",
  1238. "type": "String",
  1239. "optional": false,
  1240. "field": "Authorization",
  1241. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  1242. }
  1243. ]
  1244. },
  1245. "examples": [
  1246. {
  1247. "title": "Authorization header example:",
  1248. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  1249. "type": "string"
  1250. }
  1251. ]
  1252. },
  1253. "success": {
  1254. "examples": [
  1255. {
  1256. "title": "Success-Response:",
  1257. "content": "HTTP/1.1 200 OK",
  1258. "type": "json"
  1259. }
  1260. ]
  1261. },
  1262. "filename": "app/routes/users.js",
  1263. "groupTitle": "Users"
  1264. },
  1265. {
  1266. "type": "post",
  1267. "url": "/users",
  1268. "title": "Registration",
  1269. "version": "1.0.0",
  1270. "name": "Registration",
  1271. "group": "Users",
  1272. "header": {
  1273. "fields": {
  1274. "Header": [
  1275. {
  1276. "group": "Header",
  1277. "type": "String",
  1278. "optional": false,
  1279. "field": "Content-Type",
  1280. "description": "<p>application/json</p> "
  1281. }
  1282. ]
  1283. }
  1284. },
  1285. "parameter": {
  1286. "fields": {
  1287. "Parameter": [
  1288. {
  1289. "group": "Parameter",
  1290. "type": "<p>String</p> ",
  1291. "optional": false,
  1292. "field": "username",
  1293. "description": "<p>User's username</p> "
  1294. },
  1295. {
  1296. "group": "Parameter",
  1297. "type": "<p>String</p> ",
  1298. "optional": false,
  1299. "field": "password",
  1300. "description": "<p>User's password</p> "
  1301. },
  1302. {
  1303. "group": "Parameter",
  1304. "type": "<p>String</p> ",
  1305. "optional": true,
  1306. "field": "language",
  1307. "defaultValue": "en",
  1308. "description": "<p>User's default language</p> "
  1309. }
  1310. ]
  1311. },
  1312. "examples": [
  1313. {
  1314. "title": "Request-Example: ",
  1315. "content": "{ \n \"username\": \"John\", \n \"password\": \"s3cr3t\",\n \"language\": \"en\"\n}",
  1316. "type": "json"
  1317. }
  1318. ]
  1319. },
  1320. "success": {
  1321. "fields": {
  1322. "201": [
  1323. {
  1324. "group": "201",
  1325. "type": "<p>String</p> ",
  1326. "optional": false,
  1327. "field": "username",
  1328. "description": "<p>Username of the User.</p> "
  1329. },
  1330. {
  1331. "group": "201",
  1332. "type": "<p>String</p> ",
  1333. "optional": false,
  1334. "field": "token",
  1335. "description": "<p>The JWT valid token.</p> "
  1336. }
  1337. ]
  1338. },
  1339. "examples": [
  1340. {
  1341. "title": "Success-Response:",
  1342. "content": "HTTP/1.1 201 OK\n{\n \"username\": \"John\",\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"\n}",
  1343. "type": "json"
  1344. }
  1345. ]
  1346. },
  1347. "error": {
  1348. "fields": {
  1349. "400": [
  1350. {
  1351. "group": "400",
  1352. "type": "<p>json</p> ",
  1353. "optional": false,
  1354. "field": "BadRequest",
  1355. "description": "<p>Validation errors.</p> "
  1356. }
  1357. ],
  1358. "409": [
  1359. {
  1360. "group": "409",
  1361. "type": "<p>json</p> ",
  1362. "optional": false,
  1363. "field": "UserAlreadyExist",
  1364. "description": "<p>The user can't be found.</p> "
  1365. }
  1366. ]
  1367. },
  1368. "examples": [
  1369. {
  1370. "title": "UserAlreadyExist:",
  1371. "content": "HTTP/1.1 409 Not Found\n{\n \"message\": \"Account already exists\"\n}",
  1372. "type": "json"
  1373. },
  1374. {
  1375. "title": "BadRequest:",
  1376. "content": "HTTP/1.1 400 Bad Request\n[\n {\n \"field\": \"password\",\n \"rule\": \"required\",\n \"message\": \"Path `password` is required.\"\n },\n {\n \"field\": \"username\",\n \"rule\": \"required\",\n \"message\": \"Path `username` is required.\"\n }\n ]",
  1377. "type": "json"
  1378. }
  1379. ]
  1380. },
  1381. "filename": "app/routes/users.js",
  1382. "groupTitle": "Users"
  1383. },
  1384. {
  1385. "type": "delete",
  1386. "url": "/users",
  1387. "title": "Unregistration",
  1388. "version": "1.0.0",
  1389. "name": "Unregistration",
  1390. "group": "Users",
  1391. "header": {
  1392. "fields": {
  1393. "Header": [
  1394. {
  1395. "group": "Header",
  1396. "type": "String",
  1397. "optional": false,
  1398. "field": "Content-Type",
  1399. "description": "<p>application/json</p> "
  1400. },
  1401. {
  1402. "group": "Header",
  1403. "type": "String",
  1404. "optional": false,
  1405. "field": "Authorization",
  1406. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  1407. }
  1408. ]
  1409. },
  1410. "examples": [
  1411. {
  1412. "title": "Authorization header example:",
  1413. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  1414. "type": "string"
  1415. }
  1416. ]
  1417. },
  1418. "success": {
  1419. "fields": {
  1420. "204": [
  1421. {
  1422. "group": "204",
  1423. "optional": false,
  1424. "field": "-",
  1425. "description": ""
  1426. }
  1427. ]
  1428. },
  1429. "examples": [
  1430. {
  1431. "title": "Success-Response:",
  1432. "content": "HTTP/1.1 204 No Content",
  1433. "type": "json"
  1434. }
  1435. ]
  1436. },
  1437. "error": {
  1438. "fields": {
  1439. "401": [
  1440. {
  1441. "group": "401",
  1442. "type": "<p>json</p> ",
  1443. "optional": false,
  1444. "field": "AuthenticationFailed",
  1445. "description": "<p>The user can't be found.</p> "
  1446. }
  1447. ]
  1448. },
  1449. "examples": [
  1450. {
  1451. "title": "AuthenticationFailed:",
  1452. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  1453. "type": "json"
  1454. }
  1455. ]
  1456. },
  1457. "filename": "app/routes/users.js",
  1458. "groupTitle": "Users"
  1459. }
  1460. ] });