This endpoint is used to update basic information of a given room. The information includes name, summary, introduction, unique features, utilities, host experiences, special notes, apartment rules, apartment manual, direction manual, checkin guide and translation option.
Method | URI | Headers |
---|---|---|
GET | /api/rooms/{room}/basics | Authorization: Bearer <token> Accept: application/json Accept-Language: <language> |
Param | Description | Type | Required |
---|---|---|---|
name | The name of the room. Minimum length: 3. Maximum length: MAX_STRING_LENGTH. | String | Yes |
summary | The summary about the room. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | Yes |
introduction | The introduction to the room. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | Yes |
unique_features | Describe the unique features of the room. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | Yes |
utilities | Describe the utilities of the room. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | Yes |
host_experiences | Describe the experiences with host. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | No |
special_note | The special notes to guests. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | No |
apartment_rules | The rules of the room that guests should follow. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | Yes |
apartment_manual | The usage guides of the room for guests. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | No |
direction_manual | The direction guides of the room for guests. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | No |
checkin_guide | The check-in guides for guests. Minimum length: 20. Maximum length: MAX_TEXT_LENGTH. | String | Yes |
translate | The translation option. | Boolean | Yes |
Param | Description | Type | Required |
---|---|---|---|
{room} | The ID of a given room. | Integer | Yes |
Example request
curl \
--request POST \
--url https://api.luxstay.com/api/rooms/10000/basics \
--header 'Accept: application/json' \
--header 'Authorization: <token>' \
--form 'name=Apartment 1' \
--form 'summary=Summary about the room.' \
--form 'introduction=Introduction to the room.' \
--form 'unique_features=Describe unique features of the room.' \
--form 'utilities=Describe utilities of the room' \
--form 'host_experiences=Describe experiences of the room.' \
--form 'special_note=Notes about the room.' \
--form 'apartment_rules=Describe rules of the room.' \
--form 'apartment_manual=Describe apartment usage.' \
--form 'direction_manual=Describe how to get to the room.' \
--form 'checkin_guide=Describe the check-in guide.' \
--form translate=1
Example response
{
"data": {
"id": 10000,
"host_id": 10130,
"name": "<p>Apartment 1</p>",
"summary": "<p>Summary about the room.</p>",
"introduction": "<p>Introduction to the room.</p>",
"unique_features": "<p>Describe unique features of the room.</p>",
"utilities": "<p>Describe utilities of the room</p>",
"host_experiences": "<p>Describe experiences of the room.</p>",
"special_note": "<p>Notes about the room.</p>",
"apartment_rules": "<p>Describe rules of the room.</p>",
"apartment_manual": "<p>Describe apartment usage.</p>",
"direction_manual": "<p>Describe how to get to the room.</p>",
"checkin_guide": "<p>Describe the check-in guide.</p>",
"num_bedrooms": 5,
"num_bathrooms": 4,
"num_beds": 8,
"area": "120",
"maximum_guests": 15,
"booking_type": "instant_book",
"calendar_type": null,
"status": "Listed",
"submit_status": "Accept",
"cancellation_policy": "Flexible",
"url": "https://www.luxstay.com/rooms/10000",
"last_action": "2018-10-31T03:40:16+00:00"
}
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Reason unauthorized to update the room information
Example response
{
"message": "You are not allowed to access or change information associated with this room."
}
Reason cannot find the given room
Example response
{
"message": "Cannot find the given room"
}
Reason validation errors
Example response
{
"message": "The given data was invalid.",
"errors": {
"summary": [
"The summary must be at least 20 characters."
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"unique_features": [
"The unique features field is required."
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"translate": [
"The translate field must be true or false."
]
}
}