Skip to content

Latest commit

 

History

History
117 lines (104 loc) · 2.31 KB

room.md

File metadata and controls

117 lines (104 loc) · 2.31 KB

Back to main

Room

Add Room
Remove Room
Get All Room Info
Get All Rooms


Endpoint: /Room

Add Room

Back to the top

POST

Expected Request

{
    "body": {
        "room_name": "AB203",
        "room_length": 20,
        "room_width": 12
    },
    "action": "add_room"
}


Variable Data Type Required Additional Validation
room_name string Yes No
room_width integer Yes No
room_length integer Yes No


Expected Response:

Healthy Call

{
    "message": "Room added"
}

Unhealthy Call

{
    "error": "error message"
}

Remove Room

Back to the top

DELETE

Expected Request ?action=remove_room&room_id=6


Variable Data Type Required Additional Validation
room_id integer Yes No


Expected Response:

Healthy Call

{
    "message": "Room removed"
}

Unhealthy Call

{
    "error": "error message"
}

Get All Room Info

Back to the top

GET

Expected Request: ?action=get_all_room_info&room_id=4


Variable Data Type Required Additional Validation
room_id integer Yes No


Expected Response:

Healthy Call

{
    "message": "Json object storing information pertaining to the room"
}

Unhealthy Call

{
    "error": "error message"
}

Get All Rooms

Back to the top

GET

Expected Request ?action=get_all_rooms


Variable Data Type Required Additional Validation


Expected Response:

Healthy Call

{
    "message": "Array storing all rooms and their info"
}

Unhealthy Call

{
    "error": "error message"
}