Sub-user geofences
Which of the master account's geofences a sub-user can see.
These operations set which geofences a sub-user can see. Geofences are scoped separately from trackers, so a sub-user's geofence list is bound here rather than following from their trackers.
Two list operations exist because they answer different questions: list_ids returns only the IDs, which is what a permissions screen needs, and list returns the geofence objects themselves.
API actions
API base path: /subuser/zones.
Every operation on this page needs the multilevel_access tariff feature on all trackers, and the admin right, which is available only to master users. Failing either returns error 13 for the right and error 236 for the feature, so those two are not repeated per operation below.
Every operation here also returns error 201, Not found in the database, when the sub-user does not exist or belongs to another master user.
Give a sub-user access to geofences, either a named set or all of them.
Give either access_to_all or zone_ids. A request with neither reports a missing parameter named has_at_least_one_parameter, which is the internal name of the validation group rather than a parameter you can send; it carries a message naming the two real choices.
Master users only, and the account needs the multilevel_access plan feature on all trackers. A sub-user calling this gets error 13, and an account without the feature gets error 236.
Requires the admin 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 a sub-user belonging to the current account.
When true, the sub-user gets access to every geofence of the master account. Use this or zone_ids.
IDs of the geofences to associate with the sub-user. All must belong to the current master account. Use this or access_to_all.
Geofences bound
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 236: the account lacks the multilevel_access feature.
Error 13: the caller is a sub-user.
Error response object
POST /v2/subuser/zones/bind HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"subuser_id": 1,
"access_to_all": true,
"zone_ids": [
1
]
}{
"success": true
}Errors
These errors come in addition to the general error codes:
13 - The caller is a sub-user.
236 - The account lacks the
multilevel_accessfeature.
Take away a sub-user's access to geofences.
Master users only, and the account needs the multilevel_access plan feature on all trackers. A sub-user calling this gets error 13, and an account without the feature gets error 236.
Requires the admin 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 a sub-user belonging to the current account.
IDs of the geofences to remove from the sub-user. All must belong to the current master account.
Geofences unbound
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 236: the account lacks the multilevel_access feature.
Error 13: the caller is a sub-user.
Error response object
POST /v2/subuser/zones/unbind HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 31
{
"subuser_id": 1,
"zone_ids": [
1
]
}{
"success": true
}Errors
These errors come in addition to the general error codes:
13 - The caller is a sub-user.
236 - The account lacks the
multilevel_accessfeature.
Return just the IDs of the geofences a sub-user can see.
Use subuser/zones/list when you want the geofence objects themselves.
Master users only, and the account needs the multilevel_access plan feature on all trackers. A sub-user calling this gets error 13, and an account without the feature gets error 236.
Requires the admin 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 a sub-user belonging to the current account.
The geofence IDs in the sub-user's scope
true if request finished successfully.
trueIDs of the geofences available to the sub-user.
Bad 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 236: the account lacks the multilevel_access feature.
Error 13: the caller is a sub-user.
Error response object
POST /v2/subuser/zones/list_ids HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"subuser_id": 1
}{
"success": true,
"list": [
1
]
}Errors
These errors come in addition to the general error codes:
13 - The caller is a sub-user.
236 - The account lacks the
multilevel_accessfeature.
Return the geofences a sub-user can see, as full geofence objects, with filtering and pagination.
Master users only, and the account needs the multilevel_access plan feature on all trackers. A sub-user calling this gets error 13, and an account without the feature gets error 236.
Requires the admin 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 a sub-user belonging to the current account.
Optional. Filter over geofence label.
Optional. Tag IDs. A geofence must carry all the tags in the list to be returned.
Optional. Default id. How to order the list.
Optional. Maximum number of geofences to return.
Optional. Default 0. Offset into the results, for pagination.
The geofences in the sub-user's scope
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 236: the account lacks the multilevel_access feature.
Error 13: the caller is a sub-user.
Error response object
POST /v2/subuser/zones/list HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 80
{
"subuser_id": 1,
"filter": "text",
"tag_ids": [
1
],
"order": "id",
"limit": 1,
"offset": 1
}{
"success": true,
"list": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
]
}Errors
These errors come in addition to the general error codes:
13 - The caller is a sub-user.
236 - The account lacks the
multilevel_accessfeature.
Last updated
Was this helpful?