api.yml 7.8 KB

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