api.yml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. openapi: 3.0.3
  2. info:
  3. title: User Management API
  4. description: API that provides management functionality for Retro AIM Server operators.
  5. version: 1.0.0
  6. paths:
  7. /user:
  8. get:
  9. summary: Get all users
  10. description: Retrieve a list of all user accounts without passwords.
  11. responses:
  12. '200':
  13. description: Successful response containing a list of users without passwords.
  14. content:
  15. application/json:
  16. schema:
  17. type: array
  18. items:
  19. type: object
  20. properties:
  21. id:
  22. type: string
  23. description: User's unique identifier.
  24. screen_name:
  25. type: string
  26. description: User's screen name.
  27. post:
  28. summary: Create a new user
  29. description: Create a new user account with a screen name and password.
  30. requestBody:
  31. required: true
  32. content:
  33. application/json:
  34. schema:
  35. type: object
  36. properties:
  37. screen_name:
  38. type: string
  39. description: The user's screen name.
  40. password:
  41. type: string
  42. description: The user's password for account creation.
  43. responses:
  44. '201':
  45. description: User account created successfully.
  46. '400':
  47. description: Bad request. Invalid input data.
  48. '409':
  49. description: Conflict. A user with the specified screen name already exists.
  50. delete:
  51. summary: Delete a user
  52. description: Delete a user account specified by their screen name.
  53. requestBody:
  54. required: true
  55. content:
  56. application/json:
  57. schema:
  58. type: object
  59. properties:
  60. screen_name:
  61. type: string
  62. description: The screen name of the user to delete.
  63. responses:
  64. '204':
  65. description: User deleted successfully.
  66. '404':
  67. description: User not found.
  68. /session:
  69. get:
  70. summary: Get active sessions
  71. description: Retrieve a list of active sessions of logged in users.
  72. responses:
  73. '200':
  74. description: Successful response containing a list of active sessions.
  75. content:
  76. application/json:
  77. schema:
  78. type: object
  79. properties:
  80. count:
  81. type: integer
  82. description: The number of active sessions.
  83. sessions:
  84. type: array
  85. items:
  86. type: object
  87. properties:
  88. id:
  89. type: string
  90. description: User's unique identifier.
  91. screen_name:
  92. type: string
  93. description: User's screen name.
  94. /user/password:
  95. put:
  96. summary: Set a user's password
  97. description: Update the password for a user specified by their screen name.
  98. requestBody:
  99. required: true
  100. content:
  101. application/json:
  102. schema:
  103. type: object
  104. properties:
  105. screen_name:
  106. type: string
  107. description: The screen name of the user whose password is to be updated.
  108. password:
  109. type: string
  110. description: The new password for the user.
  111. responses:
  112. '204':
  113. description: Password updated successfully.
  114. '400':
  115. description: Bad request. Invalid input data.
  116. '404':
  117. description: User not found.
  118. /chat/room/public:
  119. get:
  120. summary: List all public chat rooms
  121. description: Retrieve a list of all public chat rooms in exchange 5.
  122. responses:
  123. '200':
  124. description: Successful response containing a list of chat rooms.
  125. content:
  126. application/json:
  127. schema:
  128. type: array
  129. items:
  130. type: object
  131. properties:
  132. name:
  133. type: string
  134. description: Name of the chat room.
  135. create_time:
  136. type: string
  137. format: date-time
  138. description: The timestamp when the chat room was created.
  139. participants:
  140. type: array
  141. description: List of participants in the chat room.
  142. items:
  143. type: object
  144. properties:
  145. id:
  146. type: string
  147. description: User's unique identifier.
  148. screen_name:
  149. type: string
  150. description: User's screen name.
  151. post:
  152. summary: Create a new public chat room
  153. description: Create a new public chat room in exchange 5.
  154. requestBody:
  155. required: true
  156. content:
  157. application/json:
  158. schema:
  159. type: object
  160. properties:
  161. name:
  162. type: string
  163. description: Name of the chat room.
  164. responses:
  165. '201':
  166. description: Chat room created successfully.
  167. '400':
  168. description: Bad request. Invalid input data.
  169. '409':
  170. description: Chat room already exists.
  171. /chat/room/private:
  172. get:
  173. summary: List all private chat rooms
  174. description: Retrieve a list of all private chat rooms in exchange 4.
  175. responses:
  176. '200':
  177. description: Successful response containing a list of chat rooms.
  178. content:
  179. application/json:
  180. schema:
  181. type: array
  182. items:
  183. type: object
  184. properties:
  185. name:
  186. type: string
  187. description: Name of the chat room.
  188. create_time:
  189. type: string
  190. format: date-time
  191. description: The timestamp when the chat room was created.
  192. creator_id:
  193. type: string
  194. description: The chat room creator user ID.
  195. participants:
  196. type: array
  197. description: List of participants in the chat room.
  198. items:
  199. type: object
  200. properties:
  201. id:
  202. type: string
  203. description: User's unique identifier.
  204. screen_name:
  205. type: string
  206. description: User's screen name.
  207. /instant-message:
  208. post:
  209. summary: Send an instant message
  210. description: Send an instant message from one user to another. No error is raised if the recipient does not exist or the user is offline. The sender screen name does not need to exist.
  211. requestBody:
  212. required: true
  213. content:
  214. application/json:
  215. schema:
  216. type: object
  217. properties:
  218. from:
  219. type: string
  220. description: The screen name of the sender.
  221. to:
  222. type: string
  223. description: The screen name of the recipient.
  224. text:
  225. type: string
  226. description: The text content of the message.
  227. responses:
  228. '200':
  229. description: Message sent successfully.
  230. '400':
  231. description: Bad request. Invalid input data.