> For the complete documentation index, see [llms.txt](https://liams-organization-5.gitbook.io/scottishglen/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liams-organization-5.gitbook.io/scottishglen/api-routes/asset-link.md).

# Asset Link

## Retrieve ALL Asset Links&#x20;

<mark style="color:blue;">`GET`</mark> `/api/asset-link/`

Use this method to get ALL Asset Links from the Database.

{% tabs %}
{% tab title="200: OK AssetLink\[]" %}
Response will be an array of [Asset Link](/scottishglen/types/asset-link.md) objects.
{% endtab %}
{% endtabs %}

## Get ALL links by Hardware ID

<mark style="color:blue;">`GET`</mark> `/api/asset-link/hardware/:id/get-all`

#### Path Parameters

| Name                                 | Type   | Description         |
| ------------------------------------ | ------ | ------------------- |
| id<mark style="color:red;">\*</mark> | String | The ID of the Asset |

{% tabs %}
{% tab title="200: OK { hardware: HardwareAsset, link: AssetLink }" %}
Response consists of both the Hardware Asset and the [Asset Link](/scottishglen/types/asset-link.md).
{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}
{% endtabs %}

## Get ALL links by Software ID

<mark style="color:blue;">`GET`</mark> `/api/asset-link/software/:id/get-all`

Response consists of both an array with the Software Asset and the [Asset Link](/scottishglen/types/asset-link.md).

#### Path Parameters

| Name                                 | Type   | Description         |
| ------------------------------------ | ------ | ------------------- |
| id<mark style="color:red;">\*</mark> | String | The ID of the Asset |

{% tabs %}
{% tab title="200: OK { software: SoftwareAsset, link: AssetLink }" %}

{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}
{% endtabs %}

## Get ALL links by Software ID (excl. Software Asset)

<mark style="color:blue;">`GET`</mark> `/api/asset-link/software/:id`

Response consists of both only the [Asset Link](/scottishglen/types/asset-link.md) array.

#### Path Parameters

| Name                                 | Type   | Description         |
| ------------------------------------ | ------ | ------------------- |
| id<mark style="color:red;">\*</mark> | String | The ID of the Asset |

{% tabs %}
{% tab title="200: OK AssetLink\[]" %}

{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}
{% endtabs %}

## Insert Asset Link

<mark style="color:green;">`POST`</mark> `/api/asset-link/`

You can use this method to insert an Asset Link into the Database.

#### Request Body

| Name                                           | Type   | Description                                                       |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------- |
| hardware\_id<mark style="color:red;">\*</mark> | String | ID of the Hardware Asset you would like to be a part of the link. |
| software\_id<mark style="color:red;">\*</mark> | String | ID of the Software Asset you would like to be a part of the link. |
| date<mark style="color:red;">\*</mark>         | String | The Date the link was created                                     |
| created\_by<mark style="color:red;">\*</mark>  | String | The E-Mail Address of the Employee who creates the link.          |

{% tabs %}
{% tab title="400: Bad Request Body is not accurate to the specification above." %}

{% endtab %}

{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

## Delete Asset Link

<mark style="color:red;">`DELETE`</mark> `/api/asset-link/hardware/:hwid/:swid`

#### Path Parameters

| Name                                   | Type   | Description                   |
| -------------------------------------- | ------ | ----------------------------- |
| hwid<mark style="color:red;">\*</mark> | String | The ID of the Hardware Asset. |
| swid<mark style="color:red;">\*</mark> | String | The ID of the Software Asset. |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://liams-organization-5.gitbook.io/scottishglen/api-routes/asset-link.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
