Photos Deletion

This endpoint is used to delete a single photo from the collection of photos of a given room.

Endpoint

Method URI Headers
DELETE /api/rooms/{room}/photos/{photo} Authorization: Bearer <token>
Accept: application/json

Route Params

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

Request & Response Examples

Successful Response

200

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'
1
2
3
4
5
6

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": []
        }
    }
}
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 delete photo of the room

Example response

{
    "message": "You are not allowed to access or change information associated with this room."
}
1
2
3
  • Reason unauthorized to delete photo which doesn't belong to room

Example response

{
    "message": "This action is unauthorized."
}
1
2
3

404

  • Reason cannot find the given room

Example response

{
    "message": "Cannot find the given room"
}
1
2
3
  • Reason cannot find the given photo

Example response

{
    "message": "Cannot find the given room photo"
}
1
2
3
Last Updated: 11/18/2018, 9:11:26 AM