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.

Prerequisites

An existing asset. Learn how to create it in Creating a custom asset.

To create a new asset link, prepare an array of assets (or use an empty array) and send the following request:

Create a new link

post
/v0/asset_link/create

Adds a new asset link for the organization

Authorizations
OAuth2authorizationCodeRequired

OAuth 2.0 authentication for Europe. Use this for users based in Europe and adjacent regions.

Authorization URL: Token URL: Refresh URL:
Available scopes:
  • : OpenID Connect scope
  • : Basic user profile
  • : User e-mail address
Body

Defines the request schema for /asset_link/create

labelstringRequired

The asset link label

Example: Boston boats
asset_idsinteger · int64[]Required

The assets of this link

Responses
200

Link created successfully

application/json
post
/v0/asset_link/create
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
}

To add an asset to an existing link, send the following request:

Assign asset to a link

post
/v0/asset_link/set

Binds an asset to the specified asset link

Authorizations
OAuth2authorizationCodeRequired

OAuth 2.0 authentication for Europe. Use this for users based in Europe and adjacent regions.

Authorization URL: Token URL: Refresh URL:
Available scopes:
  • : OpenID Connect scope
  • : Basic user profile
  • : User e-mail address
Body

Defines the request schema for /asset_link/set and /asset_link/remove

link_idinteger · int64Required

Unique identifier for the asset link

Example: 12
asset_idinteger · int64Required

Unique identifier for the asset

Example: 21
Responses
post
/v0/asset_link/set
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:

Unassign asset from a link

post
/v0/asset_link/remove

Removes an asset from a specified asset link.

Authorizations
OAuth2authorizationCodeRequired

OAuth 2.0 authentication for Europe. Use this for users based in Europe and adjacent regions.

Authorization URL: Token URL: Refresh URL:
Available scopes:
  • : OpenID Connect scope
  • : Basic user profile
  • : User e-mail address
Body

Defines the request schema for /asset_link/set and /asset_link/remove

link_idinteger · int64Required

Unique identifier for the asset link

Example: 12
asset_idinteger · int64Required

Unique identifier for the asset

Example: 21
Responses
post
/v0/asset_link/remove
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.

Last updated

Was this helpful?