Room APIs
Manage rooms on eZLO. Room methods available from UI state.
hub.room.list
Get ordered list of all available rooms.
call:
{
"method": "hub.room.list",
"id": "_ID_",
"params": {}
}
reply:
{
"error": null,
"id": "_ID_",
"result": [
{
"_id": "_OBJECT_ID_",
"name": ""
},
{
"_id": "_OBJECT_ID_",
"name": ""
}
]
}
Field | Description |
---|---|
_id | Room id |
name | Room's name |
hub.room.create
Create room.
Broadcasts | Description |
---|---|
hub.room.created | informs about room was created |
call:
{
"method": "hub.room.create",
"id": "_ID_",
"params": {
"name": "Kids room"
}
}
Field | Description |
---|---|
name | Room's name, can't be empty |
Name is limited to max 30 symbols, the name will be truncated if more symbols are passed.
reply:
{
"error": null,
"id": "_ID_",
"result": {
"_id": "_OBJECT_ID_"
}
}
Field | Description |
---|---|
_id | id of created room |
errors:
Code | Message | Data |
---|---|---|
-32600 | Bad request, name does not exist | rpc.params.notfound.name |
-32600 | Bad request, name is empty | rpc.params.empty.name |
-32500 | Room already exist | hub.room.alreadyexist |
hub.room.name.set
Set room name.
Broadcasts | Description |
---|---|
hub.room.edited | informs about room name was changed |
call:
{
"method": "hub.room.name.set",
"id": "_ID_",
"params": {
"_id": "_OBJECT_ID_",
"name":"_NEW_NAME_"
}
}
Field | Description |
---|---|
_id | Room's id |
name | New room name, can't be empty |
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
errors:
Code | Message | Data |
---|---|---|
-32600 | Bad request, name is empty | rpc.params.empty.name |
-32600 | Bad request, name does not exist | rpc.params.notfound.name |
-32500 | Room not found | nma.room.notfound |
hub.room.order.set
Set rooms order.
Broadcasts | Description |
---|---|
hub.room.reordered | informs about rooms order was changed |
call:
{
"method": "hub.room.order.set",
"id": "_ID_",
"params": {
"roomsId": [
"_OBJECT_ID_",
"_OBJECT_ID_",
"_OBJECT_ID_"
]
}
}
Fild | Description |
---|---|
_id | Room's id |
roomsId | Array of roomsId in requested order |
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.room.get
Get room.
call:
{
"method": "hub.room.get",
"id": "_ID_"
"params": {
"_id": "_OBJECT_ID_"
}
}
Field | Description |
---|---|
_id | id of target room |
reply:
{
"error": null,
"id": "_ID_",
"result": [
{
"_id": "_OBJECT_ID_",
"name": "Living Room"
}
]
}
Field | Description |
---|---|
result | Returned fields are similar to hub.room.list result |
If requested room doesn't exist, returns error.
hub.room.delete
Delete room. Unplaces from deleted room all devices.
Broadcasts | Description |
---|---|
hub.room.deleted | informs about room was deleted |
call:
{
"method": "hub.room.delete",
"id": "_ID_",
"params": {
"_id": "_OBJECT_ID_"
}
}
Field | Description |
---|---|
_id | id of target room |
If requested room doesn't exist, no error is returned.
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}
hub.room.all.delete
Delete all rooms.
Broadcasts | Description |
---|---|
hub.room.deleted | informs about room was deleted for each room |
call:
{
"method": "hub.room.all.delete",
"id": "_ID_",
"params": {}
}
reply:
{
"error": null,
"id": "_ID_",
"result": {}
}