documentation.json 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. {
  2. "application": "simple storage server",
  3. "ver": "1.0.0",
  4. "wip": true,
  5. "entrypoint": {
  6. "GET": {
  7. "/": {
  8. "desc": "get information about the server API",
  9. "params": null,
  10. "return": "description of the API"
  11. },
  12. "/authentication": {
  13. "desc": "indicates whether authentication is required on the server",
  14. "params": null,
  15. "return": [
  16. {
  17. "key": "success",
  18. "value": true
  19. },
  20. {
  21. "key": "authentication",
  22. "value": "boolean"
  23. }
  24. ]
  25. },
  26. "/token": {
  27. "desc": "indicates whether the token is valid",
  28. "params": [
  29. {
  30. "key": "user",
  31. "value": "string",
  32. "desc": "name of the user"
  33. },
  34. {
  35. "key": "token",
  36. "value": "string"
  37. }
  38. ],
  39. "return": [
  40. {
  41. "key": "success",
  42. "value": true
  43. },
  44. {
  45. "key": "valid",
  46. "value": "boolean"
  47. }
  48. ]
  49. },
  50. "/list": {
  51. "desc": "list of user files",
  52. "params": [
  53. {
  54. "key": "user",
  55. "value": "string",
  56. "desc": "name of the user"
  57. },
  58. {
  59. "key": "token",
  60. "value": "string"
  61. }
  62. ],
  63. "return": [
  64. {
  65. "key": "success",
  66. "value": true
  67. },
  68. {
  69. "key": "total",
  70. "value": "number"
  71. },
  72. {
  73. "key": "list",
  74. "value": "string array",
  75. "desc": "array of fileId"
  76. }
  77. ]
  78. },
  79. "/{fileId}": {
  80. "desc": "get a file",
  81. "params": [
  82. {
  83. "key": "user",
  84. "value": "string",
  85. "desc": "name of the user"
  86. },
  87. {
  88. "key": "token",
  89. "value": "string"
  90. }
  91. ],
  92. "return": [
  93. {
  94. "key": "success",
  95. "value": true
  96. },
  97. {
  98. "key": "fileId",
  99. "value": "string"
  100. },
  101. {
  102. "key": "filename",
  103. "value": "string"
  104. },
  105. {
  106. "key": "data",
  107. "value": "string"
  108. }
  109. ]
  110. }
  111. },
  112. "POST": {
  113. "/register": {
  114. "desc": "register a new user",
  115. "params": [
  116. {
  117. "key": "user",
  118. "value": "string",
  119. "desc": "name of the new user"
  120. },
  121. {
  122. "key": "password",
  123. "value": "string",
  124. "desc": "password of the new user"
  125. }
  126. ],
  127. "return": [
  128. {
  129. "key": "success",
  130. "value": true
  131. }
  132. ]
  133. },
  134. "/login": {
  135. "desc": "Connect a user",
  136. "params": [
  137. {
  138. "key": "user",
  139. "value": "string",
  140. "desc": "name of the user"
  141. },
  142. {
  143. "key": "password",
  144. "value": "string",
  145. "desc": "password of the new user"
  146. }
  147. ],
  148. "return": [
  149. {
  150. "key": "success",
  151. "value": true
  152. },
  153. {
  154. "key": "token",
  155. "value": "string"
  156. }
  157. ]
  158. },
  159. "/save": {
  160. "desc": "save a new file",
  161. "params": [
  162. {
  163. "key": "user",
  164. "value": "string",
  165. "desc": "name of the user"
  166. },
  167. {
  168. "key": "token",
  169. "value": "string"
  170. },
  171. {
  172. "key": "file",
  173. "value": "string",
  174. "desc": "name of the file"
  175. },
  176. {
  177. "key": "data",
  178. "value": "string",
  179. "desc": "content of the file"
  180. }
  181. ],
  182. "return": [
  183. {
  184. "key": "success",
  185. "value": true
  186. },
  187. {
  188. "key": "fileId",
  189. "value": "string"
  190. },
  191. {
  192. "key": "filename",
  193. "value": "string"
  194. }
  195. ]
  196. }
  197. },
  198. "PUT": {
  199. "/save/{fileId}": {
  200. "desc": "save an existing file",
  201. "params": [
  202. {
  203. "key": "user",
  204. "value": "string",
  205. "desc": "name of the user"
  206. },
  207. {
  208. "key": "token",
  209. "value": "string"
  210. },
  211. {
  212. "key": "data",
  213. "value": "string",
  214. "desc": "content of the file"
  215. }
  216. ],
  217. "return": [
  218. {
  219. "key": "success",
  220. "value": true
  221. },
  222. {
  223. "key": "fileId",
  224. "value": "string"
  225. }
  226. ]
  227. }
  228. },
  229. "/rename/{fileId}": {
  230. "desc": "rename an existing file",
  231. "params": [
  232. {
  233. "key": "user",
  234. "value": "string",
  235. "desc": "name of the user"
  236. },
  237. {
  238. "key": "token",
  239. "value": "string"
  240. },
  241. {
  242. "key": "name",
  243. "value": "string",
  244. "desc": "new name of the file"
  245. }
  246. ],
  247. "return": [
  248. {
  249. "key": "success",
  250. "value": true
  251. },
  252. {
  253. "key": "fileId",
  254. "value": "string"
  255. },
  256. {
  257. "key": "filename",
  258. "value": "string"
  259. }
  260. ]
  261. }
  262. },
  263. "DELETE": {
  264. "/{fileId}": {
  265. "desc": "delete an existing file",
  266. "params": [
  267. {
  268. "key": "user",
  269. "value": "string",
  270. "desc": "name of the user"
  271. },
  272. {
  273. "key": "token",
  274. "value": "string"
  275. }
  276. ],
  277. "return": [
  278. {
  279. "key": "success",
  280. "value": true
  281. }
  282. ]
  283. }
  284. },
  285. "Error": {
  286. "desc": "Return when error occurs",
  287. "returns": [
  288. {
  289. "key": "success",
  290. "value": false
  291. },
  292. {
  293. "key": "code",
  294. "value": "int"
  295. },
  296. {
  297. "key": "message",
  298. "value": "string"
  299. }
  300. ]
  301. }
  302. }