API Reference
Boundaries
Boundaries
A boundary is a virtual representation of a geographic area on a map. They are defined using a standardized data format called GeoJSON, which is a lightweight format that encodes geographic data structures using JSON syntax. The Hapn platform supports GeoJSON in the form of polygon geometries. These polygon geometries generate boundary alerts when devices enter or leave such areas. They are particularly useful in creating custom location-based workflows that trigger actions based on the relationship between devices and specific geographic areas.
Boundaries in Hapn are identified by a unique number called boundaryId
. They also support other attributes like name
, color
, location
, and geometry
which contains the actual GeoJSON polygon.
Example
{
...
"result": {
"items": [
{
"boundaryId": 316385,
"name": "Brooklyn Towers",
"created": "2021-04-23T12:57:14.000Z",
"modified": "2021-04-23T12:57:14.000Z",
"location": "115 Eastern Parkway, Brooklyn, New York 11238, United States",
"color": "#9b59b6",
"status": "active",
"geometry": {
"id": "033c88d812c21bbaabaa5f650e267156",
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
-73.96689197286175,
40.67429897688385
],
[
-73.96285891553887,
40.67351038085229
],
[
-73.96255958706571,
40.67145520797439
],
[
-73.96747487567782,
40.67269787821573
],
[
-73.96689197286175,
40.67429897688385
]
]
],
"type": "Polygon"
}
}
},
...
]
}
}
Endpoints
The Hapn API allows to create, update, and fetch boundaries in the account:
- Get Boundaries Get a list of all the boundaries in the account.
- Create Boundary Create a new boundary. A geometry object representing the geographic area is required.
- Update Boundary Update an existing boundary. The boundary identifier is required.
On This Page