Skip to content

Ipd 17882 space availability api #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
* [Get Space Blockout List](venues/venuedata/get-space-blockout-list.md)
* [Get Function Space Category List](venues/venuedata/get-function-space-category-list.md)
* [Get Function Space Availability](venues/venuedata/get-function-space-availability.md)
* [Get Available Function Spaces](venues/venuedata/get-available-function-spaces.md)
* [Get Function Space Hire Plan Rate List](<venues/venuedata/get-space-hire-plan-rate-list copy.md>)
* [Get Function Space Hire Plan Rate](venues/venuedata/get-space-hire-plan-rate.md)
* [Get Cost Center List](venues/venuedata/get-cost-center-list.md)
Expand Down
121 changes: 121 additions & 0 deletions venues/venuedata/get-available-function-spaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Get Available Function Spaces

{% swagger baseUrl="[PlatformAddress]/api/1.0/" path="venue?action=getAvailableFunctionSpaces" method="post" summary="Get Venue Function Space Availability" %}
{% swagger-description %}
Returns the availability of function spaces in a specific venue based on some filtering criteria. This API is different to [Get Function Space Availability](get-function-space-availability.md) in that besides allowing extra filtering, it returns the availability of function spaces for a maximum date-time range of 24 hours only. Availability timeslots are not returned.

{% endswagger-description %}

{% swagger-parameter name="venueId" type="integer" in="path" %}
The id of the venue
{% endswagger-parameter %}

{% swagger-parameter name="startDatetime" type="timestamp" in="path" %}
The start date and time of the activity. Format is Y-m-d H:i:s
{% endswagger-parameter %}

{% swagger-parameter name="endDatetime" type="timestamp" in="path" %}
The end date and time of the activity. Format is Y-m-d H:i:s. The date and time range that of availability that can be fetched is 24 hours.
{% endswagger-parameter %}

{% swagger-parameter name="eventType" type="integer" in="path" %}
The event type id applied to the function space
{% endswagger-parameter %}

{% swagger-parameter name="pax" type="integer" in="path" %}
The number of attendees that the function space will be used for
{% endswagger-parameter %}

{% swagger-parameter name="layoutType" type="integer" in="path" %}
The layout type of the function space
{% endswagger-parameter %}

{% swagger-parameter name="spaceIds" type="array" in="path" %}
Optionally the list of space ids to which availability will be limited.
{% endswagger-parameter %}

{% swagger-response status="200" description="" %}

```
{
"meta": {
"totalResults": 2,
"start": 0,
"perPage": 100,
"count": 2
},
"results": [
{
"id": 5991,
"name": "Main Hall",
"isAvailable": true,
"reason": null,
"conflict": null
},
{
"id": 6048,
"name": "Music hall",
"isAvailable": false,
"reason": 3,
"conflict": {
"venueId": 1,
"bookingId": 30167,
"sessionId": 25728,
"spaceId": 6048,
"startDate": "2025-07-20 09:00:00",
"endDate": "2025-07-20 10:00:00",
"pax": 10
}
}
]
}
```

{% endswagger-response %}
{% endswagger %}

## Example Request

`Get Available function spaces`

```javascript
{
"venueId":1,
"startDatetime": "2025-11-26 09:00:00",
"endDatetime": "2025-11-26 10:00:00",
"eventType": 1,
"pax": 10,
"layoutType": 1,
"spaceIds": [1]
}
```

## Returns

| Property | Data Type | Description |
| ----------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| id | integer | The id of space to which the time slots belong. |
| name | string | The name of space |
| isAvailable | boolean | Whether the space is available |
| reason | integer | The [reason](get-available-function-spaces.md#conflict-reason) why the space is unavailable |
| conflict | object | The [conflict](get-available-function-spaces.md#conflict) object if there is a conflict with an existing booking reservation |

## Conflict Reason

| Value | Description |
| ----- | ---------------------------------------------------------------------------------------------- |
| 1 | The reservation is unavailable because the space has been blocked |
| 2 | The reservation is unavailable because the max pax on space has been crossed |
| 3 | The reservation is unavailable because there is a conflict with an exiting booking reservation |

## Conflict

| Property | Data Type | Description |
| --------- | --------- | ---------------------------------------------------------------- |
| venueId | integer | The id of venue |
| bookingId | integer | The id of booking |
| sessionId | integer | The id of session |
| spaceId | integer | The id of space |
| startDate | string | The start date of the conflict |
| endDate | string | The end date of the conflict |
| pax | integer | The number of attendees that the function space will be used for |