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; bariatric_care, learning_disability_care, residential, residential_dementia, nursing, nursing_dementia, specialist_care.

The room object
{
    "_id": "66bfb4bc9ab4e3d6eb73493c",
    "archived": false,
    "created": "2024-08-16 20:21:16",
    "features": [
        "66bfb4bb9ab4e3d6eb7348a8",
        "66bfb4bb9ab4e3d6eb7348b0"
    ],
    "floor": "0",
    "funding_types": [
        "private",
        "local_authority",
        "local_authority_top_up",
        "chc",
        "chc_lifestyle",
        "block_bed",
        "dta_spot"
    ],
    "location": "66bfb4bb9ab4e3d6eb734900",
    "modified": "2024-08-16 20:21:16",
    "name_no": "01",
    "rates": {
        "66bfb4bc9ab4e3d6eb734930": 113000,
        "66bfb4bc9ab4e3d6eb734932": 135000,
        "66bfb4bc9ab4e3d6eb734934": 106000,
        "66bfb4bc9ab4e3d6eb734936": 162000,
        "66bfb4bc9ab4e3d6eb734938": 174500,
        "66bfb4bc9ab4e3d6eb73493a": 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.

    • 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": "66bfb4bc9ab4e3d6eb73493c",
            "name_no": "01"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb73493e",
            "name_no": "02"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb734940",
            "name_no": "03"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb734942",
            "name_no": "04"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb734944",
            "name_no": "05"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb734946",
            "name_no": "06"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb734948",
            "name_no": "07"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb73494a",
            "name_no": "08"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb73494c",
            "name_no": "09"
        },
        {
            "_id": "66bfb4bc9ab4e3d6eb73494e",
            "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": "66bfb4bc9ab4e3d6eb73493c",
    "archived": false,
    "created": "2024-08-16 20:21:16",
    "features": [
        "66bfb4bb9ab4e3d6eb7348a8",
        "66bfb4bb9ab4e3d6eb7348b0"
    ],
    "floor": "0",
    "funding_types": [
        "private",
        "local_authority",
        "local_authority_top_up",
        "chc",
        "chc_lifestyle",
        "block_bed",
        "dta_spot"
    ],
    "location": "66bfb4bb9ab4e3d6eb734900",
    "modified": "2024-08-16 20:21:16",
    "name_no": "01",
    "rates": {
        "66bfb4bc9ab4e3d6eb734930": 113000,
        "66bfb4bc9ab4e3d6eb734932": 135000,
        "66bfb4bc9ab4e3d6eb734934": 106000,
        "66bfb4bc9ab4e3d6eb734936": 162000,
        "66bfb4bc9ab4e3d6eb734938": 174500,
        "66bfb4bc9ab4e3d6eb73493a": 155500
    },
    "suitable_for": [
        "residential"
    ]
}