# Get Resource Availability

<mark style="color:green;">`POST`</mark> `[PlatformAddress]/api/1.0/venue?action=getResourceAvailability`

Return the availability for resources.

#### Request Body

| Name                                          | Type    | Description                                                                           |
| --------------------------------------------- | ------- | ------------------------------------------------------------------------------------- |
| venueId<mark style="color:red;">\*</mark>     | integer | The id of the venue                                                                   |
| startDate<mark style="color:red;">\*</mark>   | date    | The start date of the period from which to include the resource availability details. |
| endDate<mark style="color:red;">\*</mark>     | date    | The end date of the period from which to include the resource availability details.   |
| resourceIds<mark style="color:red;">\*</mark> | array   | The end date of the period from which to include the resource availability details.   |
| quantity                                      | integer | Specifies the quantity to check for resource availability.                            |

{% tabs %}
{% tab title="200 " %}

```
{
    "meta": {
        "totalResults": 2,
        "start": 0,
        "perPage": 100,
        "count": 2
    },
    "results": [
        {
            "id": 1,
            "unAvailableTimes": [
                {
                    "startDate": "2021-06-24 00:00:00",
                    "endDate": "2021-06-24 23:59:00",
                    "quantity": 10
                }
            ],
            "isAvailable": true,
            "conflict": null
        },
        {
            "id": 25,
            "unAvailableTimes": [
                {
                    "startDate": "2021-06-24 00:00:00",
                    "endDate": "2021-06-24 23:59:00",
                    "quantity": 10
                }
            ],
            "isAvailable": false,
            "conflict": {
                "venueId": 1,
                "bookingId": 20815,
                "sessionId": 11544,
                "spaceId": 288,
                "resourceId": 25,
                "startDate": "2021-06-24 00:00:00",
                "endDate": "2021-06-24 23:59:00",
                "quantity": 10
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Example Request

`Get Resource Availability`

```javascript
{
    "venueId": 1,
    "startDate": "2021-06-24 00:00:00",
    "endDate": "2021-06-25 00:00:00",
    "resourceIds": [1, 25],
    "quantity": 10
}
```

### Returns

`A collection object with the following properties in the results`

| Property         | Description                                                                                                                              |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| id               | The unique resource identifier                                                                                                           |
| unAvailableTimes | The reserved date time ranges for resource with quantity                                                                                 |
| isAvailble       | Whether or not resource is available for given time range and quantity. (Only when request contains quantity)                            |
| conflict         | If resource is not available (i.e. isAvailable to false), then it gives conflicted session details (Only when request contains quantity) |
