-
Notifications
You must be signed in to change notification settings - Fork 0
API Documentation
Welcome to the API documentation for our project. Here you will find detailed information about the available API endpoints, including request methods, required parameters, and sample responses.
All API requests should be made to the base URL: https://localhost:8000/api
Adds a stream to the server.
POST /stream/add
{
"userId": "1",
"title": "Sample Stream",
"description": "This is a sample description",
"photo": "https://example.com/photo.jpg"
}- Code: 201 Created
- Content:
{
"success": true,
"data": {
"streamId": 1
}
}- Code: 500 Internal Server Error
- Content:
{
"success": false,
"error": "Error: Message"
}Searches for streams based on a keyword in the title or description.
GET /stream/search
-
keyword(string): Required. The keyword to search for in the stream titles and descriptions.
Example request URL: /api/stream/search?keyword=sample
- Code: 200 OK
- Content:
{
"success": true,
"data": {
{
"id": 1,
"user_id": 1,
"title": "Sample Stream",
"description": "This is a sample stream description.",
"photo": "https://example.com/photo.jpg",
"start_time": "2024-02-20T17:21:44.000Z",
"is_active": true
},
{
"id": 2,
"user_id": 2,
"title": "Another Sample Stream",
"description": "This is another sample stream description.",
"photo": "https://example.com/another_photo.jpg",
"start_time": "2024-02-21T17:21:44.000Z",
"is_active": true
}
}
}- Code: 500 Internal Server Error
- Content:
{
"success": false,
"error": "Error: Message"
}Searches for streams based on a its ID.
GET /stream/get
-
streamId(int): Required. ID of the stream.
Example request URL: /api/stream/get/1
- Code: 200 OK
- Content:
{
"succes": true,
"data": {
{
"id": 1,
"user_id": 1,
"title": "Sample Stream",
"description": "This is a sample stream description.",
"photo": "https://example.com/photo.jpg",
"start_time": "2024-02-20T17:21:44.000Z",
"is_active": true
}
}
}- Code: 500 Internal Server Error
- Content:
{
"success": false,
"error": "Error: Message"
}Registers a user in the user management system.
POST /auth/register
{
"username": "example_user",
"email": "example@email.com",
"password": "password"
}- Code: 201 Created
- Content:
{
"success": true,
"data": {
"userId": 1
}
}- Code: 500 Internal Server Error
- Content:
{
"success": false,
"error": "Error: Message"
}Login User to the user management system.
POST /auth/login
{
"username": "example_user",
"password": "password"
}- Code: 200 OK
- Content:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
}
}- Code: 500 Internal Server Error
- Content:
{
"success": false,
"error": "Error: Message"
}Retrieves the chat history for a specific stream.
GET /chat/messages/:streamId
-
streamId(int): Required. ID of the stream for which to fetch chat history.
- Code: 200 OK
- Content:
{
"success": true,
"data": {
{
"id": 1,
"user_id": 2,
"stream_id": 1,
"body": "Hello, world!",
"timestamp": "2024-02-20T17:21:44.000Z"
},
{
"id": 2,
"user_id": 2,
"stream_id": 1,
"body": "This is a test message.",
"timestamp": "2024-02-20T17:21:44.000Z"
}
}
}- Code: 500 Internal Server Error
- Content:
{
"success": false,
"error": "Error: Message"
}Allows a user to send a message in a chat stream via WebSocket using Socket.IO.
{
"userId": 1,
"streamId": 1,
"message": "Hello, this is a test message!"
}Receive data from the members of the federation involving the live stream status.
POST /api/fed/fedeIn
{
"fedID": Int fedID
}code: 200
code: 500