Add Home

Last Updated on : 2023-06-20 15:34:46download

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 nameTypeINRequiredDescription
homeHomeObjectbodytrueThe home.
roomsListbodyfalseThe rooms.
uidStringbodytrueThe user ID.

Description of home

Parameter nameTypeINRequiredDescription
nameStringhometrueThe name of a home.
geo_nameStringhomefalseThe geographical location of a home.
lonDoublehomefalseThe longitude of a home.
latDoublehomefalseThe latitude of a home.

Return parameter

Parameter nameTypeDescription
resultLongThe 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.