Geofence point
The points that give a polygon or sausage geofence its shape, read and replaced separately from the geofence.
The points of a geofence define its shape. A polygon is bounded by its points, and a sausage runs along them. A circle has none and rejects any that are sent.
Points are handled separately from the geofence itself because one geofence can carry hundreds of them, which is why zone/list and zone/read leave them out unless with_points is set. The two operations here read and replace them directly.
Point object structure
API actions
API base path: /zone/point.
Return the points of a geofence.
Points are handled separately from the geofence itself because they arrive as large arrays. zone/read with with_points returns the same data alongside the geofence.
Also accepts GET with the same parameters as query-string values.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
ID of the geofence.
Optional. Simplify the returned list down to about this many points.
The geofence points
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error 230: this geofence type cannot have points, for example a circle.
Error response object
POST /v2/zone/point/list HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 23
{
"zone_id": 1,
"count": 1
}{
"success": true,
"list": [
{
"lat": 1,
"lng": 1,
"node": true
}
]
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database, when no geofence has the given ID or it belongs to another user.
230 - Not supported for this entity type, when the geofence cannot hold points at all, such as a circle.
Required sub-user rights: zone_update.
Replace the points of a geofence.
This is a replacement, not a merge: the array given becomes the geofence's points.
A polygon needs at least 3 points and allows at most 500. A sausage needs at least 2 and allows at most 1024. A circle takes no points at all.
Requires the zone_update right.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
ID of the geofence.
Points updated
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error 202: too many points for this geofence type. Error 284: not enough points, below 3 for a polygon or 2 for a sausage.
Error 230: this geofence type cannot have points, for example a circle.
Error response object
POST /v2/zone/point/update HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 54
{
"zone_id": 1,
"points": [
{
"lat": 1,
"lng": 1,
"node": true
}
]
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database, when no geofence has the given ID or it belongs to another user.
202 - Too many points in a geofence, when the
pointsarray exceeds the limit for the geofence's type. A polygon allows at most 500 points and a sausage at most 1024.230 - Not supported for this entity type, when the geofence cannot hold points at all, such as a circle.
284 - Not enough points for the geofence. A polygon needs at least 3 points and a sausage at least 2.
Last updated
Was this helpful?