API Documentation

API Endpoints

GET /api.php?endpoint=rentals

Returns a list of all rentals.



        

POST /api.php?endpoint=rentals

Creates a new rental. The request body should be a JSON object with the following fields:

Example request body:

{
    "date": "2024-07-15",
    "duration": "1 day",
    "guests": ["Ratty", "Mickey", "Uncle Rat"]
}
        


        

GET /api.php?endpoint=comments

Returns a list of all comments.



        

POST /api.php?endpoint=comments

Adds a comment to a rental. The request body should be a JSON object with the following fields:

Example request body:

{
    "rentalId": 0,
    "comment": "This is going to be awesome!"
}
        


        

GET /api.php?endpoint=comments&rentalId=0

Returns a list of comments for a specific rental.