BookingPropertyGroup API
Creating a BookingPropertyGroup
A bookingPropertyGroup is created by sending a POST request
/api/bookingPropertyGroups
using content-type JSON.
The body must contain the following mandatory fields:
- name
- type
- elements (if the type is enumerated)
Success is indicated with status code 201. The objected is returned containing its unique identifier.
Failure due to a badly formed user request will return an empty body and status code 400.
Request:
POST /api/bookingPropertyGroups
Content-Type: application/json
Body:
{
"name": "spin",
"code": "SPN",
"type": "enumerated",
"elements": [
{
"name": "up"
},
{
"name": "down"
}
]
}
Successful response:
Status: 201 CREATED
Content-Type: application/json
Body:
{
"id": 104,
"name": "spin",
"code": "SPN",
"elements": [
{
"id": 218,
"name": "up",
"code": null
},
{
"id": 219,
"name": "down",
"code": null
}
]
}
Retrieving a list of all BookingPropertyGroups
A list of all bookingPropertyGroups available can be retrieved by sending a GET request
/api/bookingPropertyGroups
The response is of content-type JSON and will contain a list of bookingPropertyGroups.
If no bookingPropertyGroups are available, an empty list will be returned.
GET /api/bookingPropertyGroups
Successful response:
Status: 200 OK
Content-Type: application/json
Body:
[
{
"id":101,
"name":"size",
"code":"SZ",
"type":"enumerated",
"elements":[
{
"id":201,
"name":"small",
"code":"S"
},
{
"id":202,
"name":"medium",
"code":"M"
},
{
"id":203,
"name":"large",
"code":"L"
}
]
},{
"id":105,
"name":"Sugar",
"code":"SGRZ",
"type":"boolean",
"elements":null
}
]
Retrieving a single BookingPropertyGroup
A single bookingPropertyGroup with a known unique identifier can be retrieved by sending a GET request
/api/bookingPropertyGroups/{id}
where {id} is the unique identifier of the bookingPropertyGroup.
Success is indicated with status code 200. The requested bookingPropertyGroup is returned containing its unique identifier.
GET /api/bookingPropertyGroups/105
Successful response:
Status: 200 OK
Content-Type: application/json
Body:
{
"id":105,
"name":"Sugar",
"code":"SGRZ",
"type":"boolean",
"elements":null
}
If no bookingPropertyGroup with the requested unique identifier exists, status code 404 is returned
Modifying a BookingPropertyGroup
A previously created bookingPropertyGroup is modified by sending a PUT request
/api/bookingPropertyGroup/{id}
using content-type JSON, where {id} is the unique identifier of the bookingPropertGroup.
The body must contain the following mandatory fields:
- id
- name
- code
- type
- elements (if the type is enumerated)
The ID in the request body MUST be identical to the unique identifier in the request path. Only the fields' names and codes can be modified.
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/bookingPropertyGroups/104
Content-Type: application/json
Body:
{
"id":105,
"name":"Sugar",
"code":"SGRQ",
"type": "boolean",
"elements":null
}
Successful response:
Status: 204 NO_CONTENT
Deleting a BookingPropertyGroup
A previously created bookingPropertyGroup is deleted by sending a DELETE request
/api/boookingPropertyGroup/{id}
where {id} is the unique identifier of the bookingPropertyGroup.
Success is indicated with status code 204. No body is returned.
Failure due to user error is indicated by a status code of 400.
Request:
DELETE /api/bookingPropertyGroups/104
Successful response:
Status: 204 NO_CONTENT