Experience the difference of "Elite".

Change a booking tag's value

SBF VR
Jun 25, 2021 11:16 AM
Joined Jul, 2018 22 posts

I have the booking ID, I can figure out the tag ID # from the UI... I can't figure out what call to do in the API to change the value of a booking's tag from false to true. Because the tag is being used to fire a trigger, it's important that I find a way to set it's value based on external conditions (via the API). Thanks.

Chris Hynes
Jun 25, 2021 12:24 PM
OR Team Member Joined Oct, 2012 1354 posts

Currently, there's no way to set tags on bookings via API. You can set them on guests though, via PUT (to replace existing tags for the guest with the new set you pass) or PATCH (to add) like this:

PATCH https://secure.ownerreservations.com/guests/12345
{
"Tags" : [ "7890", "foo" ]
}

You can pass either a tag id or a tag name.

SBF VR
Jun 25, 2021 1:27 PM
Joined Jul, 2018 22 posts

How would adding the tag to the guest work with triggers (if at all), which appear to look at tags on bookings and not on guests...? If it doesn't, then adding the tag to the guest doesn't get me where I'm trying to get.

Chris Hynes
Jun 25, 2021 1:32 PM
OR Team Member Joined Oct, 2012 1354 posts

The Trigger tag criteria includes tags set on the booking itself as well as on the property or guest.

SBF VR
Jun 25, 2021 1:37 PM
Joined Jul, 2018 22 posts

In the above example, is "foo" a tag name or some kind of value (I thought tags were boolean, either they existed or they didn't, so "foo" seems like a tag name, but want to be sure I'm not making a mistake)? Thanks.

Ken T
Jun 25, 2021 1:54 PM
OR Team Member Joined Aug, 2019 838 posts

Yes, that's correct - "foo" represents a generic meaningless example tag name.

SBF VR
Jun 25, 2021 2:10 PM
Joined Jul, 2018 22 posts

I have the code working, thanks!