This endpoint is used to retrieve all photos associated with a given room.
Method | URI | Headers |
---|---|---|
GET | /api/rooms/{room}/photos | Authorization: Bearer <token> Accept: application/json |
Param | Description | Type | Required |
---|---|---|---|
{room} | The ID of a given room. | Integer | Yes |
Example request
curl \
--request GET \
--url https://api.luxstay.com/api/rooms/10000/photos \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>'
Example response
{
"data": [
{
"id": 4400,
"name": "living-room.jpg",
"highlights": "",
"featured": true,
"slide": true,
"order": 0,
"caption": "<content>",
"photo_url": "https://image.luxstay.com/rooms/10000/large/living-room.jpg?w=1200&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq",
"thumbnail": "https://image.luxstay.com/rooms/10000/thumbnail/living-room.jpg?w=250&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq"
},
{
"id": 4401,
"name": "bathroom.jpg",
"highlights": "",
"featured": false,
"slide": true,
"order": 0,
"caption": "<content>",
"photo_url": "https://image.luxstay.com/rooms/10000/large/bathroom.jpg?w=1200&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq",
"thumbnail": "https://image.luxstay.com/rooms/10000/thumbnail/bathroom.jpg?w=250&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq"
},
{
"id": 4402,
"name": "bedroom.jpg",
"highlights": "",
"featured": false,
"slide": true,
"order": 0,
"caption": "<content>",
"photo_url": "https://image.luxstay.com/rooms/10000/large/bedroom.jpg?w=1200&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq",
"thumbnail": "https://image.luxstay.com/rooms/10000/thumbnail/bedroom.jpg?w=250&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq"
},
{
"id": 4403,
"name": "kitchen.jpg",
"highlights": "",
"featured": false,
"slide": true,
"order": 0,
"caption": "<content>",
"photo_url": "https://image.luxstay.com/rooms/10000/large/kitchen.jpg?w=1200&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq",
"thumbnail": "https://image.luxstay.com/rooms/10000/thumbnail/kitchen.jpg?w=250&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq"
},
{
"id": 4404,
"name": "balcony.jpg",
"highlights": "",
"featured": false,
"slide": false,
"order": 0,
"caption": "<content>",
"photo_url": "https://image.luxstay.com/rooms/10000/large/balcony.jpg?w=1200&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq",
"thumbnail": "https://image.luxstay.com/rooms/10000/thumbnail/balcony.jpg?w=250&fit=crop&v=RGb88hdhC0QcgspvCupZ0CQsq"
}
],
"meta": {
"pagination": {
"total": 5,
"count": 5,
"per_page": 15,
"current_page": 1,
"total_pages": 1,
"links": []
}
}
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Reason cannot access room photos
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"
}