Skip to content

Latest commit

 

History

History
107 lines (70 loc) · 2.42 KB

documentation.md

File metadata and controls

107 lines (70 loc) · 2.42 KB

User Actions

  1. POST Request: Signup

This POST request is used to register a new user in the system.

curl -X POST -H "Content-Type: application/json" -d '{
    "username": "sample_user",
    "email": "sample_user@gmail.com",
    "password": "sample_password123"
}' http://127.0.0.1:8080/api/v1/user/signup
  1. POST Request: Login

This POST request is used to authenticate a user and log them into the system.

curl -X POST -H "Content-Type: application/json" -d '{
    "email": "sample_email@gmail.com",
    "password": "sample_password123"
}' http://127.0.0.1:8080/api/v1/user/login
  1. GET Request: Logout

This GET request is used to log a user out from the system.

curl -X GET http://127.0.0.1:8080/api/v1/user/logout

WebSocket Actions

Create Room

  1. POST Request: Create Room

This POST request is used to create a new room.

curl -X POST -H "Content-Type: application/json" -d '{
    "id": "Room 1",
    "name": "1"
}' http://127.0.0.1:8080/api/v1/ws/createRoom

Request Body (raw, text):

{
    "id": "Room 1",
    "name": "1"
}

Join Room

  1. WebSocket Request: Join Room

    • Endpoint: ws://localhost:8080/api/v1/ws/joinRoom/67?userId=1&username=sample_user

This WebSocket request is used to join a room with the specified user ID and username.

WebSocket Connection Example:

# Example using WebSocket connection
websocat ws://localhost:8080/api/v1/ws/joinRoom/67?userId=1&username=sample_user

Get Clients by Room

  1. GET Request: Get Clients by Room

This GET request is used to retrieve clients by room.

curl -X GET http://127.0.0.1:8080/api/v1/ws/get/1

Path Variables: - 1: The room identifier (replace with the desired room ID).

Get All Rooms

  1. Get Rooms

    GET Request: Get Rooms Endpoint: http://127.0.0.1:8080/api/v1/ws/getRooms

    This GET request is used to retrieve a list of available rooms.

    curl -X GET http://127.0.0.1:8080/api/v1/ws/getRooms