Skip to content

API Documentation

Panderu edited this page Jun 28, 2025 · 2 revisions

API Specification

This document provides an overview of the available endpoints, request types, payloads, and expected responses for the Study Buddies backend server API.

Base URL

The local base URL for the API is: http://localhost:8080

Authentication

The API uses Bearer Authentication with a JWT token. Make sure to include the token in the Authorization header of your requests.

Endpoints

User Controller

1. Get Users

  • Endpoint: /user
  • Method: GET
  • Description: Retrieves all users and their associated modules.
  • Response:
    • 200 OK: Returns an array of user objects containing user details and their modules.

2. Update User Modules

  • Endpoint: /user
  • Method: PUT
  • Description: Updates the modules for a user.
  • Request Body:
    [
      {
        "name": "string",
        "examDate": "string",
        "examLoc": "string",
        "examTime": "string",
        "chapter": [
          {
            "title": "string",
            "checkbox": [
              {
                "title": "string"
              }
            ]
          }
        ]
      }
    ]
  • Response:
    • 200 OK: Returns an object confirming the update.

3. Create User

  • Endpoint: /user
  • Method: POST
  • Description: Creates a new user account.
  • Request Body:
    {
      "username": "string"
    }
  • Response:
    • 200 OK: Returns an object confirming the creation of the user account.

4. Delete User

  • Endpoint: /user
  • Method: DELETE
  • Description: Deletes a specific user.
  • Parameters:
    • targetUuid (query, required): The UUID of the user to delete.
  • Response:
    • 200 OK: Returns an object confirming the deletion.

Meeting Controller

1. Get Meeting

  • Endpoint: /meeting
  • Method: GET
  • Description: Retrieves information about meetings.
  • Parameters:
    • module (query, optional): Filter meetings by module.
  • Response:
    • 200 OK: Returns an object containing the meeting details.

2. Change Meeting

  • Endpoint: /meeting
  • Method: PUT
  • Description: Updates the details of an existing meeting.
  • Parameters:
    • id (query, required): The ID of the meeting to update.
    • date_from/date_until: Use following format: dd-MM-yyyy:HH:mm
    • repeatable: (daily, weekly, monthly, never)
  • Request Body:
    {
      "changeType": "SERIES | OCCURRENCE",
      "module": "string",
      "description": "string",
      "dateFrom": "string",
      "dateUntil": "string",
      "repeatable": "string",
      "place": "string"
    }
  • Response:
    • 200 OK: Returns an object confirming the update.

3. Create Meeting

  • Endpoint: /meeting
  • Method: POST
  • Description: Creates a new meeting.
  • Parameters:
    • dateFrom/dateUntil: Use following format: dd-MM-yyyy:HH:mm
    • repeatable: (daily, weekly, monthly, never)
  • Request Body:
    {
      "module": "string",
      "description": "string",
      "dateFrom": "string",
      "dateUntil": "string",
      "repeatable": "string",
      "place": "string"
    }
  • Response:
    • 200 OK: Returns an object confirming the creation of the meeting.

4. Delete Meeting

  • Endpoint: /meeting
  • Method: DELETE
  • Description: Deletes a specific meeting.
  • Parameters:
    • id (query, required): The ID of the meeting to delete.
  • Response:
    • 200 OK: Returns an object confirming the deletion.

Study Group Controller

1. Get Study Group

  • Endpoint: /studygroup
  • Method: GET
  • Description: Retrieves information about a specific study group.
  • Parameters:
    • uuid (query, required): The UUID of the study group to retrieve.
  • Response:
    • 200 OK: Returns an object containing the study group details.

2. Join Study Group

  • Endpoint: /studygroup
  • Method: POST
  • Description: Joins a study group.
  • Request Body:
    {
      "superMeetingId": "string",
      "meetingId": "string"
    }
  • Response:
    • 200 OK: Returns an object confirming the join operation.

3. Leave Study Group

  • Endpoint: /studygroup
  • Method: DELETE
  • Description: Leaves a study group.
  • Parameters:
    • targetUUID (query, required): The UUID of the target to remove from the study group.
  • Response:
    • 200 OK: Returns an object confirming the removal.

Module Controller

1. Get Modules

  • Endpoint: /module
  • Method: GET
  • Description: Retrieves all available modules.
  • Response:
    • 200 OK: Returns an array of module objects.

2. Create Module

  • Endpoint: /module
  • Method: POST
  • Description: Creates a new module.
  • Request Body:
    {
      "name": "string"
    }
  • Response:
    • 200 OK: Returns an object confirming the creation of the module.

Checkbox Controller

1. Toggle Checkbox

  • Endpoint: /checkbox
  • Method: POST
  • Description: Toggles the state of a checkbox.
  • Request Body:
    {
      "checkboxId": "string"
    }
  • Response:
    • 200 OK: Returns an object confirming the checkbox state change.

This API specification provides a foundation for interacting with the Study Buddies backend server. For more detailed information and examples, please refer to the dedicated wiki pages.