Rooms

A room within a location.

The room object

Attributes

  • _id
    string

    A unique Id for the room.

  • archived
    boolean

    Flag indiciating if the room has been archived.

  • created
    string

    The date/time the group was created.

  • features
    list of strings

    A list of the room's features.

  • floor
    string

    The floor the room is located on; -1, 0, 1, 2, 3, 4.

  • funding_types
    list of strings

    A list of the funding types the room is available for; private, local_authority, local_authority_top_up, chc, chc_lifestyle, block_bed, dta_spot.

  • location
    string

    The Id of the location the room is in.

  • modified
    string

    The date/time the group was modified.

  • name_no
    string

    The name/no. of the room.

  • rates
    hash

    A hash of room rates, keys are room rate type Ids and values are the rate for the room rate type.

    • rates.{room_rate_type_id}
      integer

      The rate for the room (in pence).

  • suitable_for
    list of strings

    A list of the type of care the room is suitable for; assisted_living, assisted_living_dementia, bariatric_care, learning_disability_care, residential, residential_dementia, nursing, nursing_dementia, specialist_care.

The room object
{
    "_id": "6724fbc84f73a2cebf637836",
    "archived": false,
    "created": "2024-11-01 16:03:20",
    "features": [
        "6724fbc74f73a2cebf63779a",
        "6724fbc74f73a2cebf6377a2"
    ],
    "floor": "0",
    "funding_types": [
        "private",
        "local_authority",
        "local_authority_top_up",
        "chc",
        "chc_lifestyle",
        "block_bed",
        "dta_spot"
    ],
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:20",
    "name_no": "01",
    "rates": {
        "6724fbc84f73a2cebf63782a": 113000,
        "6724fbc84f73a2cebf63782c": 135000,
        "6724fbc84f73a2cebf63782e": 106000,
        "6724fbc84f73a2cebf637830": 162000,
        "6724fbc84f73a2cebf637832": 174500,
        "6724fbc84f73a2cebf637834": 155500
    },
    "suitable_for": [
        "residential"
    ]
}

List all rooms

Return a list of rooms.

Parameters

  • attributes
    optional
    default ['_id']

    A list of attributes to include for fetched objects.

  • filters-archived
    optional
    default no

    A filter that allows rooms that are currently archived to be included or excluded.

    • unset
    • yes
    • no
  • filters-features
    optional

    A filter that accepts a list of room feature (Group) Ids and filters rooms by the features they have.

  • filters-floor
    optional

    A filter that accepts a list of floors filters rooms by the floor they are located on.

    • -1
    • 0
    • 1
    • 2
    • 3
    • 4
  • filters-funding_types
    optional

    A filter that accepts a list of funding types and filters rooms by the funding types they are available for.

    • private
    • local_authority
    • local_authority_top_up
    • chc
    • chc_lifestyle
    • block_bed
    • dta_spot
  • filters-ids
    optional

    A filter that accepts a list of Ids and filters the items returned to those with an Id in the list.

  • filters-location
    optional

    A filter that accepts a list of location Ids and filters rooms by their location.

  • filters-modified_after
    optional

    A filter that accepts a date/time and filters the items returned to those modified after the date/time.

  • filters-modified_before
    optional

    A filter that accepts a date/time and filters the items returned to those modified before the date/time.

  • filters-q
    optional

    A case insensitive keyword filter applied to the following fields; name_no.

  • filters-suitable_for
    optional

    A filter that accepts a list of care types and filters rooms by the types of care they are suitable for.

    • assisted_living
    • assisted_living_dementia
    • bariatric_care
    • learning_disability_care
    • residential
    • residential_dementia
    • nursing
    • nursing_dementia
    • specialist_care
  • page
    optional
    default 1

    The page number to fetch.

  • per_page
    optional
    default 10

    The number of items to return per page.

  • sort_by
    optional
    default _id

    A list of fields the returned items can be sorted by. Fields prefixed with minus (-) sign are sorted in descending order.

    • _id
    • created
    • floor
    • modified
    • name_no

Response

Returns a page of rooms.

GET
/v1/rooms
var rooms = apiClient.Request(
    HttpMethod.Get,
    "rooms",
    new MultiValueDict()
        .Add("attributes", "name_no")
        .Add("filters-location", locationId)
);
<?php

$rooms = $api_client->request(
    'GET',
    'rooms',
    [
        'attributes'=>['name_no'],
        'filters-location'=>$location_id
    ]
);
rooms = api_client(
    'GET',
    'rooms',
    params={
        'attributes': ['name_no'],
        'filters-location': location_id
    }
)
rooms = api_client.request(
    'GET',
    'rooms',
    params: {
        'attributes' => ['name_no'],
        'filters-location' => location_id
    }
)
Response
{
    "item_count": 35,
    "items": [
        {
            "_id": "6724fbc84f73a2cebf637836",
            "name_no": "01"
        },
        {
            "_id": "6724fbc84f73a2cebf637838",
            "name_no": "02"
        },
        {
            "_id": "6724fbc84f73a2cebf63783a",
            "name_no": "03"
        },
        {
            "_id": "6724fbc84f73a2cebf63783c",
            "name_no": "04"
        },
        {
            "_id": "6724fbc84f73a2cebf63783e",
            "name_no": "05"
        },
        {
            "_id": "6724fbc84f73a2cebf637840",
            "name_no": "06"
        },
        {
            "_id": "6724fbc84f73a2cebf637842",
            "name_no": "07"
        },
        {
            "_id": "6724fbc84f73a2cebf637844",
            "name_no": "08"
        },
        {
            "_id": "6724fbc84f73a2cebf637846",
            "name_no": "09"
        },
        {
            "_id": "6724fbc84f73a2cebf637848",
            "name_no": "10"
        }
    ],
    "page": 1,
    "page_count": 4,
    "per_page": 10
}

Retrieve a room

Retrieve a room object.

Response

Returns a room object.

GET
/v1/rooms/<room_id>
var room = apiClient.Request(HttpMethod.Get, $"rooms/{roomId}");
<?php

$room = $api_client->request('GET', 'rooms/' . $room_id);
room = api_client('GET', f'rooms/{room_id}')
room = api_client.request('GET', "rooms/#{room_id}")
Response
{
    "_id": "6724fbc84f73a2cebf637836",
    "archived": false,
    "created": "2024-11-01 16:03:20",
    "features": [
        "6724fbc74f73a2cebf63779a",
        "6724fbc74f73a2cebf6377a2"
    ],
    "floor": "0",
    "funding_types": [
        "private",
        "local_authority",
        "local_authority_top_up",
        "chc",
        "chc_lifestyle",
        "block_bed",
        "dta_spot"
    ],
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:20",
    "name_no": "01",
    "rates": {
        "6724fbc84f73a2cebf63782a": 113000,
        "6724fbc84f73a2cebf63782c": 135000,
        "6724fbc84f73a2cebf63782e": 106000,
        "6724fbc84f73a2cebf637830": 162000,
        "6724fbc84f73a2cebf637832": 174500,
        "6724fbc84f73a2cebf637834": 155500
    },
    "suitable_for": [
        "residential"
    ]
}