-
Notifications
You must be signed in to change notification settings - Fork 0
Create room endpoint
The create room endpoint is also pretty self-explanatory, this endpoint will create a new document of a room in the MongoDB database following the structure and scheme of /src/schema/roomSchema.ts
. This endpoint will return a status of '201' on success, '401' on an invalid API key or '500' on an internal server error. Furthermore, there are 4 arguments to be supplied to the endpoint. The 'id' argument is the id of the room, usually created with the uuid package. The 'name' argument is the display name of the room, a 'user' argument is the starting user in the room, a 'public' argument for if the room is public, and a 'passcode' argument is the passcode of the room(you can pass null for public rooms). I hope all of these arguments are very self-explanatory.
post("http://<URL>/api/create-room?key=<YOUR_API_KEY>", {
id: "<ID>", // I suggest creating a id using v4() function from the uuid library.
name: "<ROOM_NAME>",
user: "<USER>",
passcode:"<PASSCODE>"
public: false
}).then((res) => {
console.log(res);
}).catch((err) => {
console.error(err);
});
- Home
- Login endpoint
- Block user endpoint
- Create room endpoint
- Delete user endpoint
- Get all rooms endpoint
- Get GIF endpoint
- Get messages endpoint
- Get public rooms endpoint
- Get user info endpoint
- Get users info endpoint (Deprecated)
- Join room endpoint
- Signup endpoint
- Report room endpoint
- Remove room endpoint
- Update description endpoint
- Follow user endpoint
- Unfollow user endpoint
- Update icon color endpoint
- Upload content endpoint
- Upload content endpoint (Deprecated)
- Verify client endpoint
- Upload token endpoint
- Chill&chat websockets
- Message socket
- Keyboard socket
- Delete message socket
- User content
- Final words&thoughts
- Run API