TagType¶
Tag Types are used to describe the structure and domains of buildings and help in categorising sensors that can be easily allocated in groups to different users. TagType can be defined in the CentralService at http://www.example.com:81/api/tagtype. TagsTypes have a hierarchical structure i.e. a tag can have both parent tags and children tags. They play a very crucial role within BuildingDepot in defining permissions that restrict access to sensors based on the permissions a user has. Also, A building template is supported by a group of tag types allocated to it.
Add TagType¶
This request creates a new TagType in BuildingDepot which will be used in the Building template to define the structure of the Buildings.
Example request:
POST /api/tagtype HTTP/1.1
Accept: application/json; charset=utf-8
{ "data":
{ "name": "corridor",
"description": "passage in a building",
"parents": [ "floor" ]
}
}
Example response (for success):
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": "True"
}
Example response (for failure):
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": "False",
"error": "List of parents tags not valid"
}
Get TagType¶
This request fetches information about a TagType in BuildingDepot.
Example request:
GET /api/tagtype/floor HTTP/1.1
Accept: application/json; charset=utf-8
Example response (for success):
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": "True"
"children": [ "corridor"
],
"description": null,
"name": "floor",
"parents": [],
"success": "True"
}
Example response (for failure):
HTTP/1.1 200 OK
Content-Type: application/json
{
"success": "False",
"error": "TagType does not exist"
}