api.yml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  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. required:
  471. - id
  472. - name
  473. properties:
  474. id:
  475. type: integer
  476. description: The unique identifier of the keyword category.
  477. name:
  478. type: string
  479. description: The name of the keyword category.
  480. post:
  481. summary: Create a new keyword category
  482. description: Create a new keyword category.
  483. requestBody:
  484. required: true
  485. content:
  486. application/json:
  487. schema:
  488. type: object
  489. required:
  490. - name
  491. properties:
  492. name:
  493. type: string
  494. description: The name of the keyword category.
  495. responses:
  496. '201':
  497. description: Keyword category created successfully.
  498. content:
  499. application/json:
  500. schema:
  501. type: object
  502. properties:
  503. id:
  504. type: integer
  505. description: The ID keyword category.
  506. name:
  507. type: string
  508. description: The name of the keyword category.
  509. '400':
  510. description: Malformed input body.
  511. content:
  512. application/json:
  513. schema:
  514. type: object
  515. properties:
  516. message:
  517. type: string
  518. '409':
  519. description: A category with the specified name already exists.
  520. content:
  521. application/json:
  522. schema:
  523. type: object
  524. properties:
  525. message:
  526. type: string
  527. /directory/category/{id}:
  528. delete:
  529. summary: Delete a keyword category
  530. description: Delete a keyword category specified by its ID.
  531. parameters:
  532. - name: id
  533. in: path
  534. description: The ID of the keyword category.
  535. required: true
  536. schema:
  537. type: integer
  538. responses:
  539. '204':
  540. description: Keyword category deleted successfully.
  541. '400':
  542. description: Invalid category ID.
  543. content:
  544. application/json:
  545. schema:
  546. type: object
  547. properties:
  548. message:
  549. type: string
  550. '404':
  551. description: Keyword category not found.
  552. content:
  553. application/json:
  554. schema:
  555. type: object
  556. properties:
  557. message:
  558. type: string
  559. '409':
  560. description: The keyword category is currently in use and cannot be deleted.
  561. content:
  562. application/json:
  563. schema:
  564. type: object
  565. properties:
  566. message:
  567. type: string
  568. /directory/category/{id}/keyword:
  569. get:
  570. summary: Get all keywords in a category
  571. description: Retrieve a list of all keywords in the specified category.
  572. parameters:
  573. - name: id
  574. in: path
  575. description: The ID of the keyword category.
  576. required: true
  577. schema:
  578. type: integer
  579. responses:
  580. '200':
  581. description: Successful response containing a list of keywords.
  582. content:
  583. application/json:
  584. schema:
  585. type: array
  586. items:
  587. type: object
  588. required:
  589. - id
  590. - name
  591. - parent
  592. properties:
  593. id:
  594. type: integer
  595. description: The unique identifier of the keyword.
  596. name:
  597. type: string
  598. description: The name of the keyword.
  599. parent:
  600. type: integer
  601. description: The ID of the parent keyword category.
  602. '400':
  603. description: Invalid category ID.
  604. content:
  605. application/json:
  606. schema:
  607. type: object
  608. properties:
  609. message:
  610. type: string
  611. '404':
  612. description: Keyword category not found.
  613. content:
  614. application/json:
  615. schema:
  616. type: object
  617. properties:
  618. message:
  619. type: string
  620. /directory/keyword:
  621. post:
  622. summary: Create a new keyword
  623. description: Create a new keyword in a category.
  624. requestBody:
  625. required: true
  626. content:
  627. application/json:
  628. schema:
  629. type: object
  630. required:
  631. - name
  632. - parent
  633. properties:
  634. name:
  635. type: string
  636. description: The name of the keyword.
  637. parent:
  638. type: integer
  639. description: The ID of the parent keyword category.
  640. responses:
  641. '201':
  642. description: Keyword created successfully.
  643. content:
  644. application/json:
  645. schema:
  646. type: object
  647. properties:
  648. id:
  649. type: integer
  650. description: The keyword ID.
  651. name:
  652. type: string
  653. description: The name of the keyword.
  654. parent:
  655. type: integer
  656. description: The ID of the parent keyword category.
  657. '400':
  658. description: Malformed input body.
  659. content:
  660. application/json:
  661. schema:
  662. type: object
  663. properties:
  664. message:
  665. type: string
  666. '404':
  667. description: Parent keyword category not found.
  668. content:
  669. application/json:
  670. schema:
  671. type: object
  672. properties:
  673. message:
  674. type: string
  675. '409':
  676. description: A keyword with the specified name already exists.
  677. content:
  678. application/json:
  679. schema:
  680. type: object
  681. properties:
  682. message:
  683. type: string
  684. /directory/keyword/{id}:
  685. delete:
  686. summary: Delete a keyword
  687. description: Delete a keyword specified by its ID.
  688. parameters:
  689. - name: id
  690. in: path
  691. description: The ID of the keyword.
  692. required: true
  693. schema:
  694. type: integer
  695. responses:
  696. '204':
  697. description: Keyword deleted successfully.
  698. '404':
  699. description: Keyword not found.
  700. content:
  701. application/json:
  702. schema:
  703. type: object
  704. properties:
  705. message:
  706. type: string
  707. '409':
  708. description: Conflict. The keyword is currently in use and cannot be deleted.
  709. content:
  710. application/json:
  711. schema:
  712. type: object
  713. properties:
  714. message:
  715. type: string