This endpoint is used to update tags associated with a photo of a given room. Note that the old tags will be completely
replaced by the new ones. For example, if your photo is currently associated with tags with ID of 1
, 2
, and 3
,
you make this request with in array of IDs such as [4, 5, 6]
. Your photo now should contain only tags with ID of 4
, 5
, and 6
.
If you pass and empty array of tags via tags
parameter or omit this parameter completely. Those actions is equivalent to deleting all of current tags of the photo.
Method | URI | Headers |
---|---|---|
POST | /api/rooms/{room}/photos/{photo}/tags | Authorization: Bearer <token> Accept: application/json |
Param | Description | Type | Required |
---|---|---|---|
tags | An array of tag IDs to attach to a photo | Array | No |
Param | Description | Type | Required |
---|---|---|---|
{room} | The ID of a given room. | Integer | Yes |
{photo} | The ID of a photo associated with a given room. | Integer | Yes |
Example request
curl \
--request POST \
--url https://api.luxstay.com/api/rooms/10000/photos/4400/tags \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--form 'tags[0]=4' \
--form 'tags[1]=5' \
--form 'tags[2]=6'
Example response
{
"data": [
{
"id": 4,
"name": "Garden",
"normalized": "garden"
},
{
"id": 5,
"name": "Bathroom",
"normalized": "bathroom"
},
{
"id": 6,
"name": "Kitchen",
"normalized": "kitchen"
}
]
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Reason unauthorized to update information of the room
Example response
{
"message": "You are not allowed to access or change information associated with this room."
}
Example response
{
"message": "Cannot find the given room"
}
Example response
{
"message": "Cannot find the given photo."
}
Reason unable to update tags for a given photo
Example response
{
"message": "Unable to update tags for the given photo."
}
← Photo Tags Amenities →