This endpoint is used to delete a single photo from the collection of photos of a given room.
| Method | URI | Headers |
|---|---|---|
| DELETE | /api/rooms/{room}/photos/{photo} | Authorization: Bearer <token> Accept: application/json |
| Param | Description | Type | Required |
|---|---|---|---|
| {room} | The ID of a given room. | Integer | Yes |
| {photo} | The ID of a given room photo. | Integer | Yes |
Example request
curl \
--request DELETE \
--url https://api.luxstay.com/rooms/10000/photos/4400 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'X-HTTP-Method-Override: DELETE'
Example response
{
"data": [
{
"id": 4401,
"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": 4402,
"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"
}
],
"meta": {
"pagination": {
"total": 2,
"count": 2,
"per_page": 15,
"current_page": 1,
"total_pages": 1,
"links": []
}
}
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Example response
{
"message": "You are not allowed to access or change information associated with this room."
}
Example response
{
"message": "This action is unauthorized."
}
Example response
{
"message": "Cannot find the given room"
}
Example response
{
"message": "Cannot find the given room photo"
}