Advertisement
Lucky134Lucky

Untitled

Mar 21st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. readme: {
  2. message: "You need to specify token in body (field called 'token') or in query (field called 'token') or in header x-access-token"
  3. },
  4. authentication: {
  5. path: "api/authenticate",
  6. method: "post",
  7. params: {
  8. username: "your username",
  9. password: "ur password"
  10. }
  11. },
  12.  
  13. using: {
  14. get_current_tasks: {
  15. path: "api/current_tasks",
  16. method: "get",
  17. },
  18. submit_task: {
  19. path: "api/submit_task",
  20. method: "post",
  21. params: {
  22. id: "task id",
  23. answer: "task answer"
  24. }
  25. }
  26. },
  27.  
  28. administration: {
  29. users: {
  30. create: {
  31. path: "api/create_user",
  32. method: "post",
  33. params: {
  34. username: "user name",
  35. password: "user password",
  36. admin: "have admin rigdasifhts"
  37. }
  38. },
  39.  
  40. get_all: {
  41. path: "api/users",
  42. method: "get"
  43. },
  44.  
  45. update: {
  46. path: "api/update_user",
  47. method: "put",
  48. params: {
  49. id: "user id",
  50. username: "can use this instead of id, but can't change (maybe in future i'll add this functions, tss)",
  51. password: " new password user password (optional)",
  52. admin: "new rights (optional)",
  53. score: "new score (optional)"
  54. }
  55. },
  56.  
  57. delete_user: {
  58. path: "api/delete_user",
  59. method: "delete",
  60. params: {
  61. id: "user id. or u can use username",
  62. username: "can use this instead of id"
  63. }
  64. }
  65. },
  66. tasks: {
  67. create: {
  68. path: "api/create_task",
  69. method: "post",
  70. params: {
  71. name: "unique name of task, just like username for user",
  72. subject: "subject for task",
  73. description: "describes task",
  74. value: "how many score it gives to player for completing task",
  75. answer: "answer for this task",
  76. completed: "does task was completed?"
  77. }
  78. },
  79.  
  80. get_all: {
  81. path: "api/tasks",
  82. method: "get"
  83. },
  84.  
  85. update: {
  86. path: "api/update_task",
  87. method: "put",
  88. params: {
  89. id: "id of task you are trying to change",
  90. subject: "new subject for task (optional)",
  91. description: "new describes task (optional)",
  92. value: "new task's value (optional)",
  93. answer: "new answer for this task (optional)",
  94. completed: "new completed status (optional)"
  95. }
  96. },
  97.  
  98. delete_task: {
  99. path: "api/delete_task",
  100. method: "delete",
  101. params: {
  102. id: "task id",
  103. }
  104. }
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement