mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
feat: POST /api/v3/chats, chat room creation, plus openAPI docs update
This commit is contained in:
14
public/openapi/components/schemas/Chats.yaml
Normal file
14
public/openapi/components/schemas/Chats.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
RoomObject:
|
||||
type: object
|
||||
properties:
|
||||
owner:
|
||||
type: number
|
||||
description: the uid of the chat room owner (usually the user who created the room initially)
|
||||
roomId:
|
||||
type: string
|
||||
description: unique identifier for the chat room
|
||||
roomName:
|
||||
type: string
|
||||
groupChat:
|
||||
type: boolean
|
||||
description: whether the chat room is a group chat or not
|
||||
@@ -19,7 +19,7 @@ info:
|
||||
# Authentication
|
||||
|
||||
Please see the ["Authentication" section under the Read API](../read/#section/Overview/Authentication) for more information on how to authenticate against this API in order to make calls.
|
||||
version: 1.15.0
|
||||
version: 1.19.0
|
||||
contact:
|
||||
email: support@nodebb.org
|
||||
license:
|
||||
@@ -39,6 +39,8 @@ tags:
|
||||
description: Topic-based calls (create, modify, delete, etc.)
|
||||
- name: posts
|
||||
description: Individual post-related calls (create, modify, delete, etc.)
|
||||
- name: chats
|
||||
description: Calls related to the user private messaging system
|
||||
- name: admin
|
||||
description: Administrative calls
|
||||
- name: files
|
||||
|
||||
29
public/openapi/write/chats.yaml
Normal file
29
public/openapi/write/chats.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
post:
|
||||
tags:
|
||||
- chats
|
||||
summary: create a chat room
|
||||
description: This operation creates a new chat room and adds users to the room, if provided.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
uids:
|
||||
type: array
|
||||
example: [2, 3]
|
||||
required:
|
||||
- uids
|
||||
responses:
|
||||
'200':
|
||||
description: chat room successfully created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
$ref: ../components/schemas/Chats.yaml#/RoomObject
|
||||
Reference in New Issue
Block a user