1
0

api_data.js 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279
  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": "post",
  468. "url": "/accounts/:account_id/entries",
  469. "title": "Create entry",
  470. "version": "1.0.0",
  471. "name": "Create_entry",
  472. "group": "Entries",
  473. "parameter": {
  474. "fields": {
  475. "Parameter": [
  476. {
  477. "group": "Parameter",
  478. "type": "<p>String</p> ",
  479. "optional": false,
  480. "field": "account_id",
  481. "description": "<p>The account id to populate</p> "
  482. },
  483. {
  484. "group": "Parameter",
  485. "type": "<p>String</p> ",
  486. "optional": false,
  487. "field": "amount",
  488. "description": "<p>Amount of the entry</p> "
  489. },
  490. {
  491. "group": "Parameter",
  492. "type": "<p>String</p> ",
  493. "optional": false,
  494. "field": "date",
  495. "description": "<p>Date of the bill/deposit</p> "
  496. },
  497. {
  498. "group": "Parameter",
  499. "type": "<p>String</p> ",
  500. "optional": true,
  501. "field": "category",
  502. "description": "<p>Category id of the bill/deposit</p> "
  503. },
  504. {
  505. "group": "Parameter",
  506. "type": "<p>String</p> ",
  507. "optional": true,
  508. "field": "sub_category",
  509. "description": "<p>Sub category id of the bill/deposit</p> "
  510. },
  511. {
  512. "group": "Parameter",
  513. "type": "<p>String</p> ",
  514. "optional": true,
  515. "field": "label",
  516. "description": "<p>A label for the entry</p> "
  517. }
  518. ]
  519. },
  520. "examples": [
  521. {
  522. "title": "Request-Example: ",
  523. "content": "{\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n}",
  524. "type": "json"
  525. }
  526. ]
  527. },
  528. "header": {
  529. "fields": {
  530. "Header": [
  531. {
  532. "group": "Header",
  533. "type": "String",
  534. "optional": false,
  535. "field": "Content-Type",
  536. "description": "<p>application/json</p> "
  537. },
  538. {
  539. "group": "Header",
  540. "type": "String",
  541. "optional": false,
  542. "field": "Authorization",
  543. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  544. }
  545. ]
  546. },
  547. "examples": [
  548. {
  549. "title": "Authorization header example:",
  550. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  551. "type": "string"
  552. }
  553. ]
  554. },
  555. "error": {
  556. "fields": {
  557. "400": [
  558. {
  559. "group": "400",
  560. "type": "<p>json</p> ",
  561. "optional": false,
  562. "field": "BadRequest",
  563. "description": "<p>The user can't be found.</p> "
  564. }
  565. ],
  566. "401": [
  567. {
  568. "group": "401",
  569. "type": "<p>json</p> ",
  570. "optional": false,
  571. "field": "AuthenticationFailed",
  572. "description": "<p>The user can't be found.</p> "
  573. }
  574. ],
  575. "404": [
  576. {
  577. "group": "404",
  578. "type": "<p>json</p> ",
  579. "optional": false,
  580. "field": "AccountNotFound",
  581. "description": "<p>The account can't be found.</p> "
  582. }
  583. ]
  584. },
  585. "examples": [
  586. {
  587. "title": "AuthenticationFailed:",
  588. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  589. "type": "json"
  590. },
  591. {
  592. "title": "BadRequest:",
  593. "content": "HTTP/1.1 400 Bad Request\n [\n {\n \"field\": \"amount\",\n \"rule\": \"required\",\n \"message\": \"Path `amount` is required.\"\n }\n ]",
  594. "type": "json"
  595. },
  596. {
  597. "title": "AccountNotFound:",
  598. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  599. "type": "json"
  600. }
  601. ]
  602. },
  603. "success": {
  604. "fields": {
  605. "201": [
  606. {
  607. "group": "201",
  608. "type": "<p>Object</p> ",
  609. "optional": false,
  610. "field": "entry",
  611. "description": "<p>The created entry.</p> "
  612. },
  613. {
  614. "group": "201",
  615. "type": "<p>Object[]</p> ",
  616. "optional": false,
  617. "field": "entries",
  618. "description": "<p>All account's entries</p> "
  619. },
  620. {
  621. "group": "201",
  622. "type": "<p>Number</p> ",
  623. "optional": false,
  624. "field": "balance",
  625. "description": "<p>The account's total balance</p> "
  626. }
  627. ]
  628. },
  629. "examples": [
  630. {
  631. "title": "Success-Response:",
  632. "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}",
  633. "type": "json"
  634. }
  635. ]
  636. },
  637. "filename": "app/routes/accounts.js",
  638. "groupTitle": "Entries"
  639. },
  640. {
  641. "type": "delete",
  642. "url": "/accounts/:account_id/entries/:entry_id",
  643. "title": "Delete entry",
  644. "version": "1.0.0",
  645. "name": "Delete_entry",
  646. "group": "Entries",
  647. "parameter": {
  648. "fields": {
  649. "Parameter": [
  650. {
  651. "group": "Parameter",
  652. "type": "<p>String</p> ",
  653. "optional": false,
  654. "field": "account_id",
  655. "description": "<p>The owner account</p> "
  656. },
  657. {
  658. "group": "Parameter",
  659. "type": "<p>String</p> ",
  660. "optional": false,
  661. "field": "entry_id",
  662. "description": "<p>The entry to delete</p> "
  663. }
  664. ]
  665. }
  666. },
  667. "header": {
  668. "fields": {
  669. "Header": [
  670. {
  671. "group": "Header",
  672. "type": "String",
  673. "optional": false,
  674. "field": "Authorization",
  675. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  676. }
  677. ]
  678. },
  679. "examples": [
  680. {
  681. "title": "Authorization header example:",
  682. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  683. "type": "string"
  684. }
  685. ]
  686. },
  687. "error": {
  688. "fields": {
  689. "401": [
  690. {
  691. "group": "401",
  692. "type": "<p>json</p> ",
  693. "optional": false,
  694. "field": "AuthenticationFailed",
  695. "description": "<p>The user can't be found.</p> "
  696. }
  697. ],
  698. "404": [
  699. {
  700. "group": "404",
  701. "type": "<p>json</p> ",
  702. "optional": false,
  703. "field": "AccountNotFound",
  704. "description": "<p>The account can't be found.</p> "
  705. },
  706. {
  707. "group": "404",
  708. "type": "<p>json</p> ",
  709. "optional": false,
  710. "field": "EntryNotFound",
  711. "description": "<p>The entry can't be found.</p> "
  712. }
  713. ]
  714. },
  715. "examples": [
  716. {
  717. "title": "AuthenticationFailed:",
  718. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  719. "type": "json"
  720. },
  721. {
  722. "title": "AccountNotFound:",
  723. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  724. "type": "json"
  725. },
  726. {
  727. "title": "AccountNotFound:",
  728. "content": "HTTP/1.1 404 Not Found",
  729. "type": "json"
  730. }
  731. ]
  732. },
  733. "success": {
  734. "fields": {
  735. "204": [
  736. {
  737. "group": "204",
  738. "optional": false,
  739. "field": "-",
  740. "description": ""
  741. }
  742. ]
  743. },
  744. "examples": [
  745. {
  746. "title": "Success-Response:",
  747. "content": "HTTP/1.1 204 No Content",
  748. "type": "json"
  749. }
  750. ]
  751. },
  752. "filename": "app/routes/accounts.js",
  753. "groupTitle": "Entries"
  754. },
  755. {
  756. "type": "post",
  757. "url": "/accounts/:account_id/entries/:entry_id",
  758. "title": "Modify entry",
  759. "version": "1.0.0",
  760. "name": "Modify_entry",
  761. "group": "Entries",
  762. "parameter": {
  763. "fields": {
  764. "Parameter": [
  765. {
  766. "group": "Parameter",
  767. "type": "<p>String</p> ",
  768. "optional": false,
  769. "field": "account_id",
  770. "description": "<p>The owner account</p> "
  771. },
  772. {
  773. "group": "Parameter",
  774. "type": "<p>String</p> ",
  775. "optional": false,
  776. "field": "entry_id",
  777. "description": "<p>The entry to modify</p> "
  778. },
  779. {
  780. "group": "Parameter",
  781. "type": "<p>String</p> ",
  782. "optional": false,
  783. "field": "amount",
  784. "description": "<p>Amount of the entry</p> "
  785. },
  786. {
  787. "group": "Parameter",
  788. "type": "<p>String</p> ",
  789. "optional": false,
  790. "field": "date",
  791. "description": "<p>Date of the bill/deposit</p> "
  792. },
  793. {
  794. "group": "Parameter",
  795. "type": "<p>String</p> ",
  796. "optional": true,
  797. "field": "category",
  798. "description": "<p>Category id of the bill/deposit</p> "
  799. },
  800. {
  801. "group": "Parameter",
  802. "type": "<p>String</p> ",
  803. "optional": true,
  804. "field": "sub_category",
  805. "description": "<p>Sub category id of the bill/deposit</p> "
  806. },
  807. {
  808. "group": "Parameter",
  809. "type": "<p>String</p> ",
  810. "optional": true,
  811. "field": "label",
  812. "description": "<p>A label for the entry</p> "
  813. }
  814. ]
  815. },
  816. "examples": [
  817. {
  818. "title": "Request-Example: ",
  819. "content": "{\n amount: 1000,\n date: 2015-09-03T10:04:11.481Z\n}",
  820. "type": "json"
  821. }
  822. ]
  823. },
  824. "header": {
  825. "fields": {
  826. "Header": [
  827. {
  828. "group": "Header",
  829. "type": "String",
  830. "optional": false,
  831. "field": "Content-Type",
  832. "description": "<p>application/json</p> "
  833. },
  834. {
  835. "group": "Header",
  836. "type": "String",
  837. "optional": false,
  838. "field": "Authorization",
  839. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  840. }
  841. ]
  842. },
  843. "examples": [
  844. {
  845. "title": "Authorization header example:",
  846. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  847. "type": "string"
  848. }
  849. ]
  850. },
  851. "error": {
  852. "fields": {
  853. "400": [
  854. {
  855. "group": "400",
  856. "type": "<p>json</p> ",
  857. "optional": false,
  858. "field": "BadRequest",
  859. "description": "<p>The user can't be found.</p> "
  860. }
  861. ],
  862. "401": [
  863. {
  864. "group": "401",
  865. "type": "<p>json</p> ",
  866. "optional": false,
  867. "field": "AuthenticationFailed",
  868. "description": "<p>The user can't be found.</p> "
  869. }
  870. ],
  871. "404": [
  872. {
  873. "group": "404",
  874. "type": "<p>json</p> ",
  875. "optional": false,
  876. "field": "AccountNotFound",
  877. "description": "<p>The account can't be found.</p> "
  878. },
  879. {
  880. "group": "404",
  881. "type": "<p>json</p> ",
  882. "optional": false,
  883. "field": "EntryNotFound",
  884. "description": "<p>The entry can't be found.</p> "
  885. }
  886. ]
  887. },
  888. "examples": [
  889. {
  890. "title": "AuthenticationFailed:",
  891. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  892. "type": "json"
  893. },
  894. {
  895. "title": "BadRequest:",
  896. "content": "HTTP/1.1 400 Bad Request\n [\n {\n \"field\": \"amount\",\n \"rule\": \"required\",\n \"message\": \"Path `amount` is required.\"\n }\n ]",
  897. "type": "json"
  898. },
  899. {
  900. "title": "AccountNotFound:",
  901. "content": "HTTP/1.1 404 Not Found\n {\n \"message\": \"Unknown account\"\n }",
  902. "type": "json"
  903. },
  904. {
  905. "title": "AccountNotFound:",
  906. "content": "HTTP/1.1 404 Not Found",
  907. "type": "json"
  908. }
  909. ]
  910. },
  911. "success": {
  912. "fields": {
  913. "200": [
  914. {
  915. "group": "200",
  916. "type": "<p>Object</p> ",
  917. "optional": false,
  918. "field": "entry",
  919. "description": "<p>The created entry.</p> "
  920. },
  921. {
  922. "group": "200",
  923. "type": "<p>Object[]</p> ",
  924. "optional": false,
  925. "field": "entries",
  926. "description": "<p>All account's entries</p> "
  927. },
  928. {
  929. "group": "200",
  930. "type": "<p>Number</p> ",
  931. "optional": false,
  932. "field": "balance",
  933. "description": "<p>The account's total balance</p> "
  934. }
  935. ]
  936. },
  937. "examples": [
  938. {
  939. "title": "Success-Response:",
  940. "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}",
  941. "type": "json"
  942. }
  943. ]
  944. },
  945. "filename": "app/routes/accounts.js",
  946. "groupTitle": "Entries"
  947. },
  948. {
  949. "type": "post",
  950. "url": "/users/login",
  951. "title": "Login",
  952. "version": "1.0.0",
  953. "name": "Login",
  954. "group": "Users",
  955. "header": {
  956. "fields": {
  957. "Header": [
  958. {
  959. "group": "Header",
  960. "type": "String",
  961. "optional": false,
  962. "field": "Content-Type",
  963. "description": "<p>application/json</p> "
  964. }
  965. ]
  966. }
  967. },
  968. "parameter": {
  969. "fields": {
  970. "Parameter": [
  971. {
  972. "group": "Parameter",
  973. "type": "<p>String</p> ",
  974. "optional": false,
  975. "field": "username",
  976. "description": "<p>User's username</p> "
  977. },
  978. {
  979. "group": "Parameter",
  980. "type": "<p>String</p> ",
  981. "optional": false,
  982. "field": "password",
  983. "description": "<p>User's password</p> "
  984. }
  985. ]
  986. },
  987. "examples": [
  988. {
  989. "title": "Request-Example: ",
  990. "content": "{ \n \"username\": \"John\", \n \"password\": \"s3cr3t\" \n}",
  991. "type": "json"
  992. }
  993. ]
  994. },
  995. "success": {
  996. "fields": {
  997. "Success 200": [
  998. {
  999. "group": "Success 200",
  1000. "type": "<p>String</p> ",
  1001. "optional": false,
  1002. "field": "username",
  1003. "description": "<p>Username of the User.</p> "
  1004. },
  1005. {
  1006. "group": "Success 200",
  1007. "type": "<p>String</p> ",
  1008. "optional": false,
  1009. "field": "token",
  1010. "description": "<p>The JWT valid token.</p> "
  1011. }
  1012. ]
  1013. },
  1014. "examples": [
  1015. {
  1016. "title": "Success-Response:",
  1017. "content": "HTTP/1.1 200 OK\n{\n \"username\": \"John\",\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"\n}",
  1018. "type": "json"
  1019. }
  1020. ]
  1021. },
  1022. "error": {
  1023. "fields": {
  1024. "401": [
  1025. {
  1026. "group": "401",
  1027. "type": "<p>json</p> ",
  1028. "optional": false,
  1029. "field": "AuthenticationFailed",
  1030. "description": "<p>The user can't be found.</p> "
  1031. }
  1032. ]
  1033. },
  1034. "examples": [
  1035. {
  1036. "title": "AuthenticationFailed:",
  1037. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  1038. "type": "json"
  1039. }
  1040. ]
  1041. },
  1042. "filename": "app/routes/users.js",
  1043. "groupTitle": "Users"
  1044. },
  1045. {
  1046. "type": "delete",
  1047. "url": "/users/login",
  1048. "title": "Logout",
  1049. "version": "1.0.0",
  1050. "name": "Logout",
  1051. "group": "Users",
  1052. "header": {
  1053. "fields": {
  1054. "Header": [
  1055. {
  1056. "group": "Header",
  1057. "type": "String",
  1058. "optional": false,
  1059. "field": "Authorization",
  1060. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  1061. }
  1062. ]
  1063. },
  1064. "examples": [
  1065. {
  1066. "title": "Authorization header example:",
  1067. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  1068. "type": "string"
  1069. }
  1070. ]
  1071. },
  1072. "success": {
  1073. "examples": [
  1074. {
  1075. "title": "Success-Response:",
  1076. "content": "HTTP/1.1 200 OK",
  1077. "type": "json"
  1078. }
  1079. ]
  1080. },
  1081. "filename": "app/routes/users.js",
  1082. "groupTitle": "Users"
  1083. },
  1084. {
  1085. "type": "post",
  1086. "url": "/users",
  1087. "title": "Registration",
  1088. "version": "1.0.0",
  1089. "name": "Registration",
  1090. "group": "Users",
  1091. "header": {
  1092. "fields": {
  1093. "Header": [
  1094. {
  1095. "group": "Header",
  1096. "type": "String",
  1097. "optional": false,
  1098. "field": "Content-Type",
  1099. "description": "<p>application/json</p> "
  1100. }
  1101. ]
  1102. }
  1103. },
  1104. "parameter": {
  1105. "fields": {
  1106. "Parameter": [
  1107. {
  1108. "group": "Parameter",
  1109. "type": "<p>String</p> ",
  1110. "optional": false,
  1111. "field": "username",
  1112. "description": "<p>User's username</p> "
  1113. },
  1114. {
  1115. "group": "Parameter",
  1116. "type": "<p>String</p> ",
  1117. "optional": false,
  1118. "field": "password",
  1119. "description": "<p>User's password</p> "
  1120. },
  1121. {
  1122. "group": "Parameter",
  1123. "type": "<p>String</p> ",
  1124. "optional": true,
  1125. "field": "language",
  1126. "defaultValue": "en",
  1127. "description": "<p>User's default language</p> "
  1128. }
  1129. ]
  1130. },
  1131. "examples": [
  1132. {
  1133. "title": "Request-Example: ",
  1134. "content": "{ \n \"username\": \"John\", \n \"password\": \"s3cr3t\",\n \"language\": \"en\"\n}",
  1135. "type": "json"
  1136. }
  1137. ]
  1138. },
  1139. "success": {
  1140. "fields": {
  1141. "201": [
  1142. {
  1143. "group": "201",
  1144. "type": "<p>String</p> ",
  1145. "optional": false,
  1146. "field": "username",
  1147. "description": "<p>Username of the User.</p> "
  1148. },
  1149. {
  1150. "group": "201",
  1151. "type": "<p>String</p> ",
  1152. "optional": false,
  1153. "field": "token",
  1154. "description": "<p>The JWT valid token.</p> "
  1155. }
  1156. ]
  1157. },
  1158. "examples": [
  1159. {
  1160. "title": "Success-Response:",
  1161. "content": "HTTP/1.1 201 OK\n{\n \"username\": \"John\",\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"\n}",
  1162. "type": "json"
  1163. }
  1164. ]
  1165. },
  1166. "error": {
  1167. "fields": {
  1168. "400": [
  1169. {
  1170. "group": "400",
  1171. "type": "<p>json</p> ",
  1172. "optional": false,
  1173. "field": "BadRequest",
  1174. "description": "<p>Validation errors.</p> "
  1175. }
  1176. ],
  1177. "409": [
  1178. {
  1179. "group": "409",
  1180. "type": "<p>json</p> ",
  1181. "optional": false,
  1182. "field": "UserAlreadyExist",
  1183. "description": "<p>The user can't be found.</p> "
  1184. }
  1185. ]
  1186. },
  1187. "examples": [
  1188. {
  1189. "title": "UserAlreadyExist:",
  1190. "content": "HTTP/1.1 409 Not Found\n{\n \"message\": \"Account already exists\"\n}",
  1191. "type": "json"
  1192. },
  1193. {
  1194. "title": "BadRequest:",
  1195. "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 ]",
  1196. "type": "json"
  1197. }
  1198. ]
  1199. },
  1200. "filename": "app/routes/users.js",
  1201. "groupTitle": "Users"
  1202. },
  1203. {
  1204. "type": "delete",
  1205. "url": "/users",
  1206. "title": "Unregistration",
  1207. "version": "1.0.0",
  1208. "name": "Unregistration",
  1209. "group": "Users",
  1210. "header": {
  1211. "fields": {
  1212. "Header": [
  1213. {
  1214. "group": "Header",
  1215. "type": "String",
  1216. "optional": false,
  1217. "field": "Content-Type",
  1218. "description": "<p>application/json</p> "
  1219. },
  1220. {
  1221. "group": "Header",
  1222. "type": "String",
  1223. "optional": false,
  1224. "field": "Authorization",
  1225. "description": "<p>The valid JWT token provided by the {post} /users/login resource</p> "
  1226. }
  1227. ]
  1228. },
  1229. "examples": [
  1230. {
  1231. "title": "Authorization header example:",
  1232. "content": "\"Authorization\": \"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTVlNmU0ZTAwNTIzMGY0OTI3MWM3MDc4IiwiaWF0IjoxNDQxMTk1MjMyfQ.eWh9nuXVVSVDKKCmTMDoc9FBU55-KgkiOJH1hrdQRTQ\"",
  1233. "type": "string"
  1234. }
  1235. ]
  1236. },
  1237. "success": {
  1238. "fields": {
  1239. "204": [
  1240. {
  1241. "group": "204",
  1242. "optional": false,
  1243. "field": "-",
  1244. "description": ""
  1245. }
  1246. ]
  1247. },
  1248. "examples": [
  1249. {
  1250. "title": "Success-Response:",
  1251. "content": "HTTP/1.1 204 No Content",
  1252. "type": "json"
  1253. }
  1254. ]
  1255. },
  1256. "error": {
  1257. "fields": {
  1258. "401": [
  1259. {
  1260. "group": "401",
  1261. "type": "<p>json</p> ",
  1262. "optional": false,
  1263. "field": "AuthenticationFailed",
  1264. "description": "<p>The user can't be found.</p> "
  1265. }
  1266. ]
  1267. },
  1268. "examples": [
  1269. {
  1270. "title": "AuthenticationFailed:",
  1271. "content": "HTTP/1.1 401 Not Found\n{\n \"message\": \"Authentication failed\"\n}",
  1272. "type": "json"
  1273. }
  1274. ]
  1275. },
  1276. "filename": "app/routes/users.js",
  1277. "groupTitle": "Users"
  1278. }
  1279. ] });