Listing Or Unlisting

This endpoint is used to list or unlist a given room. This is just a way to toggle the available status of the room.

Endpoint

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

Data Params

Param Description Type Required
status The status of the room.
Available statuses are Listed and Unlisted.
String 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 PATCH \
  --url https://api.luxstay.com/api/rooms/10000/status \
  --header 'Accept: application/json' \
  --header 'Accept-Language: en' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data status=Listed
1
2
3
4
5
6
7
8

Example response

{
    "data": {
        "id": 10000,
        "host": 10130,
        "name": "Apartment 1",
        "num_bedrooms": 2,
        "num_bathrooms": 2,
        "num_beds": 2,
        "standard_guests": 5,
        "maximum_guests": 8,
        "booking_type": "request_to_book",
        "status": "Unlisted",
        "submit_status": "Accept",
        "cancellation_policy": "Flexible",
        "bedType": {
            "data": {
                "id": 4,
                "name": "Couch"
            }
        },
        "roomType": {
            "data": {
                "id": 2,
                "name": "Private room",
                "description": "Private room"
            }
        },
        "propertyType": {
            "data": {
                "id": 1,
                "name": "Apartment",
                "description": "Apartment"
            }
        }
    }
}
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

400

Reason invalid previous status

Example response

{
    "message": "This room must be accepted by Luxstay before changing its status"
}
1
2
3

422

Reason validation errors

Example response

{
    "message": "The given data was invalid.",
    "errors": {
        "status": [
            "The status field is required."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "status": [
            "The selected status is invalid."
        ]
    }
}
1
2
3
4
5
6
7
8

403

Reason unauthorized to update 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
Last Updated: 11/18/2018, 9:11:26 AM