Structure Modification

This endpoint is used to update the physical or structural information of a given room including the number of beds, the number of bedrooms and bathrooms, room area, etc.

Endpoint

Method URI Headers
POST /api/rooms/{room}/structure Authorization: Bearer <token>
Accept: application/json

Data Params

Param Description Type Required
property_type The property type of the room.
This should be a valid property type ID.
Integer Yes
maximum_guests The maximum number of guests a room may have. Integer Yes
room_type The type of the room.
This should be a valid room type ID.
Integer Yes
num_bedrooms The number of bedrooms. Integer Yes
num_beds The number of beds Integer Yes
bed_type The type of beds.
This should be a valid bed type ID.
Integer Yes
num_bathrooms The number of bathrooms. Integer Yes
area The area of the room. Double Yes

Route Params

Param Description Type Required
{room} The ID of a given room. Integer Yes

Request & Response Examples

Successful Response

200

Example request

curl \
  --request POST \
  --url https://api.luxstay.com/api/rooms/10000/structure \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <token>' \
  --form property_type=28 \
  --form room_type=21 \
  --form bed_type=4 \
  --form maximum_guests=15 \
  --form num_bedrooms=5 \
  --form num_beds=8 \
  --form num_bathrooms=4 \
  --form area=120
1
2
3
4
5
6
7
8
9
10
11
12
13

Example response

{
    "data": {
        "id": 10000,
        "host": 10130,
        "name": "Apartment 1",
        "num_bedrooms": 5,
        "num_bathrooms": 4,
        "num_beds": 8,
        "standard_guests": 5,
        "maximum_guests": 15,
        "booking_type": "instant_book",
        "status": "Listed",
        "submit_status": "Accept",
        "cancellation_policy": "Flexible",
        "bedType": {
            "data": {
                "id": 4,
                "name": "Couch"
            }
        },
        "roomType": {
            "data": {
                "id": 21,
                "name": "Test",
                "description": "Test"
            }
        },
        "propertyType": {
            "data": {
                "id": 28,
                "name": "Studio",
                "description": ""
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

Error Response

401

Reason invalid access token

Example response

{
    "message": "Unauthenticated."
}
1
2
3

403

Reason unauthorized to update structure of the room

Example response

{
    "message": "You are not allowed to access or change information associated with this room."
}
1
2
3

404

Reason cannot find the given room

Example response

{
    "message": "Cannot find the given room"
}
1
2
3

422

Reason validation errors

Example response

{
    "message": "The given data was invalid.",
    "errors": {
        "property_type": [
            "The selected property type is invalid."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "room_type": [
            "The selected room type is invalid."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "bed_type": [
            "The selected bed type is invalid."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "area": [
            "The area format is invalid."
        ]
    }
}
1
2
3
4
5
6
7
8
Last Updated: 11/18/2018, 9:11:26 AM