Skip to main content

BookingProperty API

Retrieving the BookingProperties for a booking

A List of BookingProperties for a booking with a known unique identifier can be retrieved by sending a GET request to

/api/bookingProperties/{id}

where {id} is the unique identifier of the booking.

Success is indicated with status code 200.

GET /api/bookingProperties/101

Successful response:

Status: 200 OK
Content-Type: application/json
Body:
[
{
"groupId": 103,
"elementId": 216
},
{
"groupId": 102,
"elementId": 213
},
{
"groupId": 101,
"elementId": 201
}
]

As a convenience, the bookingProperties can be decorated with element- and groupnames by adding the request parameter named=true.

GET /api/bookingProperties/101?named=true

Successful response:

Status: 200 OK
Content-Type: application/json
Body:
[
{
"groupId": 102,
"elementId": 213,
"groupName": "colour",
"elementName": "cerulean"
},
{
"groupId": 101,
"elementId": 201,
"groupName": "size",
"elementName": "S"
},
{
"groupId": 103,
"elementId": 216,
"groupName": "spin",
"elementName": "down"
}
]

Setting the BookingProperties for a booking

BookingProperties for a given booking are modified by sending a PUT request to

/api/bookingProperties/{bookingId}

using content-type JSON, where {bookingId} is the unique identifier of the booking.

Each bookingProperty must contain the following mandatory fields:

  • groupId
  • elementId

Success is indicated with status code 204. No body is returned.

Failure due to user error is indicated by status code 400.

request:

PUT /api/bookingProperties/101
Content-Type: application/json
Body:
[
{
"groupId": 103,
"elementId": 216
}
]

Successful response:

Status: 204 NO_CONTENT