Areas
Create an Area
POSThttps://api.hivekit.io/v2/realm/[realmId]/area/[areaId]
Creates a new Area. The area's shape can be either a circle, rectangle or polygon. The shape is defined by the shape
property in the request body. The shape can be a circle, rectangle, or polygon. The shape is specified as a JSON object with the following fields:
- Circle:
{"cx":<longitude>,"cy":<latitude>,"r":<radius in meter>}
- Rectangle:
{"w":<longitude>,"n":<latitude>,"e":<longitude>,"s":<latitude>}
- Polygon:
{"points":[[<longitude>,<latitude>],...]}
Request Body
{
"label": "Area A", // required
"shape": {
"cx": 12.34, // required longitude in degree
"cy": 56.78, // required latitude in degree
"r": 100000, // required radius in meters
}
"data": { // optional
"name": "Circle A",
}
}
Response Body
{
"id": "area-a",
"result": "success"
}
Update an Area
PATCH https://api.hivekit.io/v2/realm/[realmId]/area/[areaId]#
Updates an existing Area. You can change the shape, label and data of an area. New data properties will be merged into existing ones, so if your area's current data is {"firstname": "Homer"}
and you update it with {"lastname": "Simpson"}
, the resulting data will be {"firstname": "Homer", "lastname": "Simpson"}
. To remove a property, set it to null
.
Request Body
{
"label": "Berlin Kreuzberg",
"shape": {
"w": 13.3889,
"n": 52.4976,
"e": 13.4376,
"s": 52.4886
}
"data": {
"district name": "Kreuzberg",
}
}
Response Body
{
"id": "area-a",
"result": "success"
}
Read an Area
GEThttps://api.hivekit.io/v2/realm/[realmId]/area/[areaId]
Response Body
{
"id": "area-a",
"label": "Area A",
"shape": {
"cx": 12.34,
"cy": 56.78,
"r": 100000,
},
"data": {
"name": "Circle A",
}
}
List Areas
GEThttps://api.hivekit.io/v2/realm/[realmId]/area
Response Body
{
"area-a": {
"id": "area-a",
"label": "Area A",
"shapeType": "circle",
},
"area-b": {
"id": "area-b",
"label": "Area B",
"shapeType": "polygon",
}
}
Delete an Area
DELETEhttps://api.hivekit.io/v2/realm/[realmId]/area/[areaId]
Response Body
{
"id": "area-a",
"result": "success"
}