This section provides detailed information on how to interact with LibraryLab’s API. Below are examples of common API endpoints, along with their descriptions, request formats, and sample responses.

To execute endpoints, run the backend, open your browser, and navigate to http://localhost:8080/swagger-ui.html. You should see the Swagger UI interface, allowing you to explore and interact with the endpoints.

  1. Navigate to the Endpoint:

    • In the Swagger UI, you’ll see a list of available endpoints on the left-hand side. Click on the endpoint you want to execute. This will expand to show details about the endpoint, including its parameters.
  2. Enter Parameters (if any):

    • If the endpoint requires parameters, you’ll see fields to enter these parameters. Fill in the required fields with the appropriate values.
  3. Execute the Endpoint:

    • After filling in the parameters (if needed), you’ll see a “Try it out” button. Click on this button.
  4. Review Request:

    • Swagger will show you the HTTP request that will be sent to the server based on the parameters you provided. You can review this request to ensure it looks correct.
  5. Execute the Request:

    • If everything looks good, click the “Execute” button.
  6. View Response:

    • Swagger will send the request to the server, and once the server responds, you’ll see the response displayed in the Swagger UI. This will include the HTTP status code, response headers, and the response body.