api.yml 24 KB

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