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