Query Room List

Last Updated on : 2023-10-18 10:11:13download

Query the list of rooms under a specified home.

API address

GET: /v1.0/homes/{home_id}/rooms

Request parameter

Parameter nameTypeINRequiredDescription
home_idLonguritrueThe ID of a home.

Return parameter

Parameter nameTypeDescription
resultHomeAndRoomsResThe list of rooms.

Description of result

Parameter nameTypeDescription
home_idLongThe ID of a home.
nameStringThe name of a home.
lonDoubleThe longitude of a home.
latDoubleThe latitude of a home.
geo_nameStringThe detailed address.
roomsListThe list of rooms.

Description of rooms

Parameter nameTypeDescription
room_idLongThe ID of a room.
nameStringThe name of a room.

Request example

GET: GET /v1.0/homes/337403/rooms

Return example

{
    "result": {
        "rooms": [
            {
                "room_id": 587609,
                "name": "Living Room"
            },
            {
                "room_id": 587610,
                "name": "Master Bedroom"
            },
            {
                "room_id": 587611,
                "name": "Second Bedroom"
            }
        ],
        "lon": 120.0640923396687,
        "name": "Test Home",
        "home_id": 337403,
        "lat": 30.302553689454005,
        "geo_name": "Hangzhou Grand Center"
    },
    "t": 1611394597651,
    "success": true
}

Error code

For more information, see error code.