api.yml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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.
  11. responses:
  12. '200':
  13. description: Successful response containing a list of users.
  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 AIM screen name or ICQ UIN.
  27. is_icq:
  28. type: boolean
  29. description: If true, indicates an ICQ user instead of an AIM user.
  30. post:
  31. summary: Create a new user
  32. description: Create a new AIM or ICQ user account.
  33. requestBody:
  34. required: true
  35. content:
  36. application/json:
  37. schema:
  38. type: object
  39. required:
  40. - screen_name
  41. - password
  42. properties:
  43. screen_name:
  44. type: string
  45. description: The user's AIM screen name or ICQ UIN.
  46. password:
  47. type: string
  48. description: The user's password for account creation.
  49. responses:
  50. '201':
  51. description: User account created successfully.
  52. '400':
  53. description: Bad request. Invalid input data.
  54. '409':
  55. description: Conflict. A user with the specified screen name or ICQ UIN already exists.
  56. delete:
  57. summary: Delete a user
  58. description: Delete a user account specified by their screen name.
  59. requestBody:
  60. required: true
  61. content:
  62. application/json:
  63. schema:
  64. type: object
  65. properties:
  66. screen_name:
  67. type: string
  68. description: The screen name of the user to delete.
  69. responses:
  70. '204':
  71. description: User deleted successfully.
  72. '404':
  73. description: User not found.
  74. /user/{screenname}/account:
  75. get:
  76. summary: Get account details for a specific screen name.
  77. description: Retrieve account details for a specific screen name.
  78. parameters:
  79. - name: screenname
  80. in: path
  81. description: User's AIM screen name or ICQ UIN.
  82. required: true
  83. type: string
  84. responses:
  85. '200':
  86. description: Successful response containing account details
  87. content:
  88. application/json:
  89. schema:
  90. type: object
  91. properties:
  92. id:
  93. type: string
  94. description: User's unique identifier.
  95. screen_name:
  96. type: string
  97. description: User's AIM screen name or ICQ UIN.
  98. profile:
  99. type: string
  100. description: User's AIM profile HTML.
  101. email_address:
  102. type: string
  103. description: User's email address
  104. confirmed:
  105. type: bool
  106. description: User's account confirmation status
  107. is_icq:
  108. type: boolean
  109. description: If true, indicates an ICQ user instead of an AIM user.
  110. '404':
  111. description: User not found.
  112. /user/{screenname}/icon:
  113. get:
  114. summary: Get AIM buddy icon for a screen name
  115. description: Retrieve account buddy icon for a specific screen name.
  116. parameters:
  117. - name: screenname
  118. in: path
  119. description: User's AIM screen name or ICQ UIN.
  120. required: true
  121. type: string
  122. responses:
  123. '200':
  124. description: Successful response containing buddy icon bytes
  125. content:
  126. image/gif:
  127. schema:
  128. type: string
  129. format: binary
  130. image/jpeg:
  131. schema:
  132. type: string
  133. format: binary
  134. image/png:
  135. schema:
  136. type: string
  137. format: binary
  138. application/octet-stream:
  139. schema:
  140. type: string
  141. format: binary
  142. '404':
  143. description: User not found, or user has no buddy icon
  144. /session:
  145. get:
  146. summary: Get active sessions
  147. description: Retrieve a list of active sessions of logged in users.
  148. responses:
  149. '200':
  150. description: Successful response containing a list of active sessions.
  151. content:
  152. application/json:
  153. schema:
  154. type: object
  155. properties:
  156. count:
  157. type: integer
  158. description: The number of active sessions.
  159. sessions:
  160. type: array
  161. items:
  162. type: object
  163. properties:
  164. id:
  165. type: string
  166. description: User's unique identifier.
  167. screen_name:
  168. type: string
  169. description: User's AIM screen name or ICQ UIN.
  170. online_seconds:
  171. type: float
  172. description: Number of seconds this user session has been online.
  173. away_message:
  174. type: string
  175. description: User's AIM away message HTML. Empty if the user is not away.
  176. idle_seconds:
  177. type: float
  178. description: Number of seconds this user session has been idle. 0 if not idle.
  179. is_icq:
  180. type: boolean
  181. description: If true, indicates an ICQ user instead of an AIM user.
  182. /session/{screenname}:
  183. get:
  184. summary: Get active sessions for a given screen name or UIN.
  185. description: Retrieve a list of active sessions of a specific logged in user.
  186. parameters:
  187. - name: screenname
  188. in: path
  189. description: User's AIM screen name or ICQ UIN.
  190. required: true
  191. type: string
  192. responses:
  193. '200':
  194. description: Successful response containing a list of active sessions for the given screen name
  195. content:
  196. application/json:
  197. schema:
  198. type: object
  199. properties:
  200. count:
  201. type: integer
  202. description: The number of active sessions.
  203. sessions:
  204. type: array
  205. items:
  206. type: object
  207. properties:
  208. id:
  209. type: string
  210. description: User's unique identifier.
  211. screen_name:
  212. type: string
  213. description: User's AIM screen name or ICQ UIN.
  214. online_seconds:
  215. type: float
  216. description: Number of seconds this user session has been online.
  217. away_message:
  218. type: string
  219. description: User's AIM away message HTML. Empty if the user is not away.
  220. idle_seconds:
  221. type: float
  222. description: Number of seconds this user session has been idle. 0 if not idle.
  223. is_icq:
  224. type: boolean
  225. description: If true, indicates an ICQ user instead of an AIM user.
  226. '404':
  227. description: User not found.
  228. /user/password:
  229. put:
  230. summary: Set a user's password
  231. description: Update the password for a user specified by their screen name or ICQ UIN.
  232. requestBody:
  233. required: true
  234. content:
  235. application/json:
  236. schema:
  237. type: object
  238. required:
  239. - screen_name
  240. - password
  241. properties:
  242. screen_name:
  243. type: string
  244. description: The AIM screen name or ICQ UIN of the user whose password is to be updated.
  245. password:
  246. type: string
  247. description: The new password for the user.
  248. responses:
  249. '204':
  250. description: Password updated successfully.
  251. '400':
  252. description: Bad request. Invalid input data.
  253. '404':
  254. description: User not found.
  255. /chat/room/public:
  256. get:
  257. summary: List all public AIM chat rooms
  258. description: Retrieve a list of all public AIM chat rooms in exchange 5.
  259. responses:
  260. '200':
  261. description: Successful response containing a list of chat rooms.
  262. content:
  263. application/json:
  264. schema:
  265. type: array
  266. items:
  267. type: object
  268. properties:
  269. name:
  270. type: string
  271. description: Name of the chat room.
  272. create_time:
  273. type: string
  274. format: date-time
  275. description: The timestamp when the chat room was created.
  276. participants:
  277. type: array
  278. description: List of participants in the chat room.
  279. items:
  280. type: object
  281. properties:
  282. id:
  283. type: string
  284. description: User's unique identifier.
  285. screen_name:
  286. type: string
  287. description: User's AIM screen name.
  288. post:
  289. summary: Create a new public chat room
  290. description: Create a new public chat room in exchange 5.
  291. requestBody:
  292. required: true
  293. content:
  294. application/json:
  295. schema:
  296. type: object
  297. properties:
  298. name:
  299. type: string
  300. description: Name of the chat room.
  301. responses:
  302. '201':
  303. description: Chat room created successfully.
  304. '400':
  305. description: Bad request. Invalid input data.
  306. '409':
  307. description: Chat room already exists.
  308. /chat/room/private:
  309. get:
  310. summary: List all private AIM chat rooms
  311. description: Retrieve a list of all private AIM chat rooms in exchange 4.
  312. responses:
  313. '200':
  314. description: Successful response containing a list of chat rooms.
  315. content:
  316. application/json:
  317. schema:
  318. type: array
  319. items:
  320. type: object
  321. properties:
  322. name:
  323. type: string
  324. description: Name of the chat room.
  325. create_time:
  326. type: string
  327. format: date-time
  328. description: The timestamp when the chat room was created.
  329. creator_id:
  330. type: string
  331. description: The chat room creator user ID.
  332. participants:
  333. type: array
  334. description: List of participants in the chat room.
  335. items:
  336. type: object
  337. properties:
  338. id:
  339. type: string
  340. description: User's unique identifier.
  341. screen_name:
  342. type: string
  343. description: User's AIM screen name.
  344. /instant-message:
  345. post:
  346. summary: Send an instant message
  347. 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.
  348. requestBody:
  349. required: true
  350. content:
  351. application/json:
  352. schema:
  353. type: object
  354. properties:
  355. from:
  356. type: string
  357. description: The AIM screen name or ICQ UIN of the sender.
  358. to:
  359. type: string
  360. description: The AIM screen name or ICQ UIN of the recipient.
  361. text:
  362. type: string
  363. description: The text content of the message.
  364. responses:
  365. '200':
  366. description: Message sent successfully.
  367. '400':
  368. description: Bad request. Invalid input data.
  369. /version:
  370. get:
  371. summary: Get build information of RAS.
  372. description: Retrieve the build version, git commit, and build date of the running RAS binary.
  373. responses:
  374. '200':
  375. description: Successful response containing the build information.
  376. content:
  377. application/json:
  378. schema:
  379. type: object
  380. properties:
  381. version:
  382. type: string
  383. description: The release version number.
  384. commit:
  385. type: string
  386. description: The latest git commit hash in this build.
  387. date:
  388. type: string
  389. description: The build date and timestamp in RFC3339 format.
  390. /directory/category:
  391. get:
  392. summary: Get all keyword categories
  393. description: Retrieve a list of all keyword categories.
  394. responses:
  395. '200':
  396. description: Successful response containing a list of keyword categories.
  397. content:
  398. application/json:
  399. schema:
  400. type: array
  401. items:
  402. type: object
  403. required:
  404. - id
  405. - name
  406. properties:
  407. id:
  408. type: integer
  409. description: The unique identifier of the keyword category.
  410. name:
  411. type: string
  412. description: The name of the keyword category.
  413. post:
  414. summary: Create a new keyword category
  415. description: Create a new keyword category.
  416. requestBody:
  417. required: true
  418. content:
  419. application/json:
  420. schema:
  421. type: object
  422. required:
  423. - name
  424. properties:
  425. name:
  426. type: string
  427. description: The name of the keyword category.
  428. responses:
  429. '201':
  430. description: Keyword category created successfully.
  431. content:
  432. application/json:
  433. schema:
  434. type: object
  435. properties:
  436. id:
  437. type: integer
  438. description: The ID keyword category.
  439. name:
  440. type: string
  441. description: The name of the keyword category.
  442. '400':
  443. description: Malformed input body.
  444. content:
  445. application/json:
  446. schema:
  447. type: object
  448. properties:
  449. message:
  450. type: string
  451. '409':
  452. description: A category with the specified name already exists.
  453. content:
  454. application/json:
  455. schema:
  456. type: object
  457. properties:
  458. message:
  459. type: string
  460. /directory/category/{id}:
  461. delete:
  462. summary: Delete a keyword category
  463. description: Delete a keyword category specified by its ID.
  464. parameters:
  465. - name: id
  466. in: path
  467. description: The ID of the keyword category.
  468. required: true
  469. schema:
  470. type: integer
  471. responses:
  472. '204':
  473. description: Keyword category deleted successfully.
  474. '400':
  475. description: Invalid category ID.
  476. content:
  477. application/json:
  478. schema:
  479. type: object
  480. properties:
  481. message:
  482. type: string
  483. '404':
  484. description: Keyword category not found.
  485. content:
  486. application/json:
  487. schema:
  488. type: object
  489. properties:
  490. message:
  491. type: string
  492. '409':
  493. description: The keyword category is currently in use and cannot be deleted.
  494. content:
  495. application/json:
  496. schema:
  497. type: object
  498. properties:
  499. message:
  500. type: string
  501. /directory/category/{id}/keyword:
  502. get:
  503. summary: Get all keywords in a category
  504. description: Retrieve a list of all keywords in the specified category.
  505. parameters:
  506. - name: id
  507. in: path
  508. description: The ID of the keyword category.
  509. required: true
  510. schema:
  511. type: integer
  512. responses:
  513. '200':
  514. description: Successful response containing a list of keywords.
  515. content:
  516. application/json:
  517. schema:
  518. type: array
  519. items:
  520. type: object
  521. required:
  522. - id
  523. - name
  524. - parent
  525. properties:
  526. id:
  527. type: integer
  528. description: The unique identifier of the keyword.
  529. name:
  530. type: string
  531. description: The name of the keyword.
  532. parent:
  533. type: integer
  534. description: The ID of the parent keyword category.
  535. '400':
  536. description: Invalid category ID.
  537. content:
  538. application/json:
  539. schema:
  540. type: object
  541. properties:
  542. message:
  543. type: string
  544. '404':
  545. description: Keyword category not found.
  546. content:
  547. application/json:
  548. schema:
  549. type: object
  550. properties:
  551. message:
  552. type: string
  553. /directory/keyword:
  554. post:
  555. summary: Create a new keyword
  556. description: Create a new keyword in a category.
  557. requestBody:
  558. required: true
  559. content:
  560. application/json:
  561. schema:
  562. type: object
  563. required:
  564. - name
  565. - parent
  566. properties:
  567. name:
  568. type: string
  569. description: The name of the keyword.
  570. parent:
  571. type: integer
  572. description: The ID of the parent keyword category.
  573. responses:
  574. '201':
  575. description: Keyword created successfully.
  576. content:
  577. application/json:
  578. schema:
  579. type: object
  580. properties:
  581. id:
  582. type: integer
  583. description: The keyword ID.
  584. name:
  585. type: string
  586. description: The name of the keyword.
  587. parent:
  588. type: integer
  589. description: The ID of the parent keyword category.
  590. '400':
  591. description: Malformed input body.
  592. content:
  593. application/json:
  594. schema:
  595. type: object
  596. properties:
  597. message:
  598. type: string
  599. '404':
  600. description: Parent keyword category not found.
  601. content:
  602. application/json:
  603. schema:
  604. type: object
  605. properties:
  606. message:
  607. type: string
  608. '409':
  609. description: A keyword with the specified name already exists.
  610. content:
  611. application/json:
  612. schema:
  613. type: object
  614. properties:
  615. message:
  616. type: string
  617. /directory/keyword/{id}:
  618. delete:
  619. summary: Delete a keyword
  620. description: Delete a keyword specified by its ID.
  621. parameters:
  622. - name: id
  623. in: path
  624. description: The ID of the keyword.
  625. required: true
  626. schema:
  627. type: integer
  628. responses:
  629. '204':
  630. description: Keyword deleted successfully.
  631. '404':
  632. description: Keyword not found.
  633. content:
  634. application/json:
  635. schema:
  636. type: object
  637. properties:
  638. message:
  639. type: string
  640. '409':
  641. description: Conflict. The keyword is currently in use and cannot be deleted.
  642. content:
  643. application/json:
  644. schema:
  645. type: object
  646. properties:
  647. message:
  648. type: string