Add Home

Last Updated on : 2023-06-01 06:20:49download

Add a home and rooms for a specified user.

Note: You can add only the home and leave the room blank.

API address

POST: /v1.0/home/create-home

Request parameter

Description of body

Parameter name Type IN Required Description
home HomeObject body true The home.
rooms List body false The rooms.
uid String body true The user ID.

Description of home

Parameter name Type IN Required Description
name String home true The name of a home.
geo_name String home false The geographical location of a home.
lon Double home false The longitude of a home.
lat Double home false The latitude of a home.

Return parameter

Parameter name Type Description
result Long The home ID.

Request example

POST: /v1.0/home/create-home
{
  "uid": "ay1528964101460qL***",
  "home": {
    "geo_name": "Hangzhou Grand Center",
    "name": "My Home",
    "lat": 30.16,
    "lon": 120.5
  },
  "rooms": [
    "Kitchen",
    "Bathroom"
  ]
}

Return example

{
    "result": 3182004,
    "t": 1540615024283,
    "success": true
}

Error code

For more information, see error code.