Asset groups
Group assets of different types so they are tracked and reported on together.
An asset group binds assets of different types together so they can be handled as one unit. A group holds at most one asset of each type.
Membership is exclusive: an asset already in a group cannot join another unless the request sets force_reassign. Deleting a group marks it deleted rather than erasing it, so its history stays intact.
Every operation here works only on assets the current user can reach. A request that names an asset outside that reach returns error 291, and a group whose assets have all become unreachable returns error 287.
Asset group entry
Asset group object entry
Asset entry
API actions
API base path: /asset_group.
Operations that list no errors of their own return only the general error codes.
Create an asset group, and return its ID.
Only one asset of each type per group.
When an asset already belongs to another group, force_reassign decides what happens: false refuses with error 290 and lists the conflicts, true moves the asset and reports what it removed in reassigned_assets.
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.
Optional. Name of the group. Defaults to the new entry's own ID.
Optional. Default false. When true, assets already in another group are moved, and their previous assignments removed.
The created group
true if request finished successfully.
trueID of the group.
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 291: the request contains assets not accessible to the user.
Error 290: an asset is already in a group and force_reassign is false. The response body carries assigned_assets, naming the existing assignments.
Error response object
POST /v2/asset_group/create HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 75
{
"name": "text",
"assets": [
{
"id": 1,
"type": "employee"
}
],
"force_reassign": true
}{
"success": true,
"id": 1,
"reassigned_assets": [
{
"asset": {
"id": 1,
"type": "employee"
},
"group_id": 1
}
]
}Errors
These errors come in addition to the general error codes:
290 - Asset already assigned to a group, when
force_reassignisfalseand an asset in the request already belongs to one. The response carriesassigned_assets, a list of the asset group objects already assigned.291 - All assets in the request must be accessible, when the request names an asset the user cannot reach.
List asset groups, by group ID or by the asset they contain.
At most one of group_ids and asset may be given, and neither is also fine. An empty body succeeds. Sending both is what fails, reporting the validation group has_not_both_group_ids_and_asset_fields with the message "None or one of the fields must be present".
Callable with an empty body.
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.
Groups to return. Use this or asset, not both.
Matching asset groups
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 response object
POST /v2/asset_group/list HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"group_ids": [
1
],
"asset": {
"id": 1,
"type": "employee"
}
}{
"success": true,
"list": [
{
"id": 1,
"name": "text",
"assets": [
{
"id": 1,
"type": "employee"
}
]
}
]
}Put assets into an existing group.
Only one asset of each type per group, and assets must not be empty.
When an asset already belongs to another group, force_reassign decides what happens: false refuses with error 290 and lists the conflicts, true moves the asset and reports what it removed in reassigned_assets.
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 group.
Optional. Default false. When true, assets already in another group are moved, and their previous assignments removed.
Assets set
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 291: the request contains assets not accessible to the user.
Error 290: an asset is already in a group and force_reassign is false. The response body carries assigned_assets, naming the existing assignments.
Error response object
POST /v2/asset_group/set HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 68
{
"id": 1,
"assets": [
{
"id": 1,
"type": "employee"
}
],
"force_reassign": true
}{
"success": true,
"reassigned_assets": [
{
"asset": {
"id": 1,
"type": "employee"
},
"group_id": 1
}
]
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database, when no such group exists.
290 - Asset already assigned to a group, when
force_reassignisfalseand an asset in the request already belongs to one. The response carriesassigned_assets, a list of the asset group objects already assigned.291 - All assets in the request must be accessible, when the request names an asset the user cannot reach.
Take assets out of a group.
Every asset named must already be in the group, or the call fails with error 286 and removes nothing. assets must not be empty.
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 group.
Assets removed
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 286: not every named asset is in the group. Error 287: the group contains no assets accessible to the user.
Error response object
POST /v2/asset_group/remove HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 46
{
"id": 1,
"assets": [
{
"id": 1,
"type": "employee"
}
]
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database, when no such group exists.
286 - All assets must be present in the group, when the request names an asset the group does not hold.
287 - At least 1 asset in the group must be accessible, when the group holds no asset the user can reach.
Change the name of an asset group. This is the only field it changes: use asset_group/set and asset_group/remove to alter membership.
name must not be empty.
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 group.
New name for the group. Must not be empty.
Group renamed
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 287: at least one asset in the group must be accessible to the user.
Error response object
POST /v2/asset_group/update HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 22
{
"id": 1,
"name": "text"
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database, when no such group exists.
287 - At least 1 asset in the group must be accessible, when the group holds no asset the user can reach.
The group is marked as deleted and its history stays intact.
Delete an asset group.
The group is marked deleted rather than erased, so its history stays intact.
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 group.
Group deleted
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 289: the group contains assets not accessible to the user.
Error response object
POST /v2/asset_group/delete HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 8
{
"id": 1
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database, when no such group exists.
289 - All assets in the group must be accessible, when the group holds an asset the user cannot reach.
Last updated
Was this helpful?