Configuring an asset link
In Navixy Repository API, asset links are user-created collections of assets grouped by a certain principle, such as a truck, a trailer, and the equipment it carries, or vehicles parked at a specific site. These links help organize and manage assets that work together or have logical relationships.
An asset link can contain assets of all types. Links automatically manage asset relationships and handle reassignments when assets are moved between groups.
In this guide, you will learn about how asset links are structured, how to create them, and how to assign assets to them.
How to configure an asset link
Note that {BASE_URL} in sample requests is a placeholder for the URL you'll be using, which depends on your geographical location and the current version of the API. To learn the specific server URLs, see API environments.
Prerequisites
An existing asset. Learn how to create it in Creating a custom asset.
Step 1. Create a new asset link
To create a new asset link, prepare an array of assets (or use an empty array) and send the following request:
Adds a new asset link for the organization
OAuth 2.0 authentication for Europe. Use this for users based in Europe and adjacent regions.
- : OpenID Connect scope
- : Basic user profile
- : User e-mail address
Defines the request schema for /asset_link/create
The asset link label
Boston boatsThe assets of this link
Link created successfully
Invalid request or validation error
Authentication is required
POST /repo/v0/asset_link/create HTTP/1.1
Host: api.navixy.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 40
{
"label": "Boston boats",
"asset_ids": [
1
]
}{
"id": 123
}Use this request body:
curl -L \
--request POST \
--url '{BASE_URL}/asset_link/create' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"label": "Boston boats",
"asset_ids": [
3
]
}'You will receive a response with the new link ID:
{
"id": 789
}Step 2. Add an asset to an existing link
To add an asset to an existing link, send the following request:
Binds an asset to the specified asset link
OAuth 2.0 authentication for Europe. Use this for users based in Europe and adjacent regions.
- : OpenID Connect scope
- : Basic user profile
- : User e-mail address
Defines the request schema for /asset_link/set and /asset_link/remove
Unique identifier for the asset link
12Unique identifier for the asset
21Asset successfully assigned to the link (No Content)
Invalid request or validation error
Authentication is required
Specified asset link not found
POST /repo/v0/asset_link/set HTTP/1.1
Host: api.navixy.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 28
{
"link_id": 12,
"asset_id": 21
}No content
Use this request body:
curl -L \
--request POST \
--url '{BASE_URL}/asset_link/create' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"label": "Boston boats",
"asset_ids": [
3
]
}'You will receive 204 No Content response, and the asset will be added to the asset_ids array.
Step 3. (Optional) Remove an asset from an asset link
To remove an asset from an existing link, send the following request:
Removes an asset from a specified asset link.
OAuth 2.0 authentication for Europe. Use this for users based in Europe and adjacent regions.
- : OpenID Connect scope
- : Basic user profile
- : User e-mail address
Defines the request schema for /asset_link/set and /asset_link/remove
Unique identifier for the asset link
12Unique identifier for the asset
21Asset successfully unassigned from the link (No Content)
Invalid request or validation error
Authentication is required
Specified asset link or assets not found
POST /repo/v0/asset_link/remove HTTP/1.1
Host: api.navixy.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 28
{
"link_id": 12,
"asset_id": 21
}No content
Use this request body:
curl -L \
--request POST \
--url '{BASE_URL}/asset_link/remove' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"link_id": 789,
"asset_id": 2
}'You will receive an empty response body and a 204 No Content status, and the asset will be removed from the asset_ids array.
Congratulations! You've successfully created and configured an asset link.
Last updated
Was this helpful?