Create a new object.
| Name |
Type |
Description |
name |
string |
The name of the object. |
properties |
ObjectProperty[] |
The properties of the object. |
description |
string or NULL |
The description of the object. |
parentId |
string or NULL |
The parent id of the object. |
allowAnonymous |
boolean |
Whether the object is accessible by anonymous users. |
200 OK (Object ID)
400 Bad Request
401 Unauthorized
404 Not Found
curl -i
-X POST
-H "Content-Type: application/json"
-d '{
"name": "LED",
"description": "This is LED",
"properties": [
{
"key": "status",
"value": 0,
"canHaveHistory": true,
"historyLimit": 100,
"mqttProperty":{
"display": true,
"subscribe": false
}
},
{
"key": "brightness",
"value": 10,
"canHaveHistory": true,
"historyLimit": 100,
"mqttProperty":{
"display": true,
"subscribe": true
}
}
],
"allowAnonymous": true
}'
http://localhost:3000/api/object/create
List all objects.
| Name |
Type |
Description |
viewProperties |
boolean |
The properties to be displayed. |
viewType |
array or something string |
The type of the view. |
| Name |
Type |
Description |
id |
string |
The id of the object. |
name |
string |
The name of the object. |
parentId |
string or NULL |
The parent id of the object. |
updatedAt |
string |
The last update date of the object. |
properties |
string[]` |
The children of the object. |
properties |
if viewType == array then ObjectProperty[] else {[key:string]: value} |
The properties of the object. |
description |
string or NULL |
The description of the object. |
allowAnonymous |
boolean |
Whether the object is accessible by anonymous users. |
systemObject |
boolean |
Whether the object is a system object. |
200 OK (Object array)
401 Unauthorized
403 Forbidden
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/list
List all objects ID`s.
200 OK (Object ID`s array)
401 Unauthorized
403 Forbidden
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/list/ids
Return the object with the given id.
| Name |
Type |
Description |
id |
string |
The id of the object. |
| Name |
Type |
Description |
viewProperties |
boolean |
The properties to be displayed. |
viewType |
array or something string |
The type of the view. |
| Name |
Type |
Description |
id |
string |
The id of the object. |
name |
string |
The name of the object. |
parentId |
string or NULL |
The parent id of the object. |
updatedAt |
string |
The last update date of the object. |
children |
string[] |
The children of the object. |
properties |
if viewType == array then ObjectProperty[] else {[key:string]: value} |
The properties of the object. |
description |
string or NULL |
The description of the object. |
allowAnonymous |
boolean |
Whether the object is accessible by anonymous users. |
systemObject |
boolean |
Whether the object is a system object. |
200 OK (Object)
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/list/5f9f1b9b-1b5a-4b1f-9c1c-1b5a4b1f9c1c
Get an object.
| Name |
Type |
Description |
id |
string |
The id of the object. |
200 OK
400 Bad Request
401 Unauthorized
404 Not Found
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/get/5f9f1b9b-1b5a-4b1f-9c1c-1b5a4b1f9c1c
Get the root objects ID`s.
200 OK
401 Unauthorized
404 Not Found
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/get-root
Get the children of an object.
GET /api/object/get/:id/children
| Name |
Type |
Description |
id |
string |
The id of the object. |
200 OK (Objects ID`s array)
400 Bad Request
401 Unauthorized
404 Not Found
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/get/5f9f1b9b-1b5a-4b1f-9c1c-1b5a4b1f9c1c/children
Get the history of an object property.
GET /api/object/get/:id/:prop/history
| Name |
Type |
Description |
id |
string |
The id of the object. |
prop |
string |
The name of the property. |
200 OK
{
current: value,
history: [
{
value: value,
date: date
},
...
]
}
400 Bad Request
401 Unauthorized
404 Not Found
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/get/5f9f1b9b-1b5a-4b1f-9c1c-1b5a4b1f9c1c/status/history
Update an object.
PUT /api/object/update/:id
| Name |
Type |
Description |
id |
string |
The id of the object. |
| Name |
Type |
Description |
name |
string or NULL |
The name of the object. |
description |
string or NULL |
The description of the object. |
allowAnonymous |
boolean or NULL |
Whether the object is accessible by anonymous users. |
parentId |
string or NULL |
The parent id of the object. |
children |
string[] or NULL |
The children of the object. |
200 OK
400 Bad Request
401 Unauthorized
404 Not Found
curl -i
-X PUT
-H "Content-Type: application/json"
-d '{
"name": "LED",
"description": "This is LED",
"allowAnonymous": true,
"parentId": "45345345-1b5a-4b1f-9c1c-1b5a4b1f9c1c",
"children": ["453453453-1b5a-4b1f-9c1c-1b5a4b1f9c1c"]
}'
http://localhost:3000/api/object/update/5f9f1b9b-1b5a-4b1f-9c1c-1b5a4b1f9c1c
Update the object of an object.
PUT /api/object/update/:id/object
| Name |
Type |
Description |
id |
string |
The id of the object. |
200 OK
400 Bad Request
401 Unauthorized
404 Not Found
curl -i
-X PUT
-H "Content-Type: application/json"
-d '[
{
"key": "status",
"value": true,
"canHaveHistory": true,
"historyLimit": 100
}
]'
http://localhost:3000/api/object/update/5f9f1b9b-1b5a-4b1f-9c1c-1b5a4b1f9c1c/object
Set the value of an object property.
GET /api/object/set/:id?key=:key&value=:value
| Name |
Type |
Description |
id |
string |
The id of the object. |
key |
string |
The name of the property. |
value |
string |
The value of the property. |
200 OK
400 Bad Request
401 Unauthorized
404 Not Found
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/set/5f9f1b9b-1b5a-4b1f-9c1c-1b5a4b1f9c1c?key=status&value=true
Remove an object.
DELETE /api/object/remove/:id
| Name |
Type |
Description |
id |
string |
The id of the object. |
200 OK
400 Bad Request
401 Unauthorized
404 Not Found
curl -i
-X DELETE
-H "Content-Type: application/json"
http://localhost:3000/api/object/remove/5f9f1b9b-1b5a-4b1f-9c1c-1b5a4b1f9c1c
Search objects.
| Name |
Type |
Description |
query |
string |
The query to search for. |
200 OK
400 Bad Request
401 Unauthorized
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/object/search?query=LED