---
title: LinkedDataApi
summary: .NET SDK: the Linked data operations, 15 methods, each with its parameters, result and a complete example.
order: 11
languages: [csharp]
sdk-package: .NET SDK · BIMworks.Sdk
link-terms: true
---

# LinkedDataApi

[[page:reference/sdk/dotnet|.NET SDK]] · `BIMworks.Sdk.Api` · class · 15 methods

Files, URLs, texts and identifiers linked to objects, which follow their objects to later Versions

Construct it with the client of [[page:reference/sdk/dotnet#connect|the connect step]]: `client.GetRequiredService<ILinkedDataApi>()`. Each method is one operation of the [[page:api|API part]], where it runs on its page.

<table class="dense">
<thead><tr><th>Method</th><th>Operation</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#addlinktargets|AddLinkTargetsAsync]]</code></td><td>[[openapi:AddLinkTargets]]</td><td>Link an existing item to more objects</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#confirmlinkmatch|ConfirmLinkMatchAsync]]</code></td><td>[[openapi:ConfirmLinkMatch]]</td><td>Confirm that a link to check is on the right object</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#deletelinkeddata|DeleteLinkedDataAsync]]</code></td><td>[[openapi:DeleteLinkedData]]</td><td>Delete items from every object and Version</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#downloadlinkeddata|DownloadLinkedDataAsync]]</code></td><td>[[openapi:DownloadLinkedData]]</td><td>The content of one item, as uploaded</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#endlink|EndLinkAsync]]</code></td><td>[[openapi:EndLink]]</td><td>End a link from a Version on</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#getlinkeddata|GetLinkedDataAsync]]</code></td><td>[[openapi:GetLinkedData]]</td><td>One item with its links and their trail across Versions</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#getlinkeddatacounts|GetLinkedDataCountsAsync]]</code></td><td>[[openapi:GetLinkedDataCounts]]</td><td>Which objects of a Version have linked data</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#getlinkeddatapolicy|GetLinkedDataPolicyAsync]]</code></td><td>[[openapi:GetLinkedDataPolicy]]</td><td>What this server accepts as linked data</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#linkdata|LinkDataAsync]]</code></td><td>[[openapi:LinkData]]</td><td>Link files, URLs, texts or identifiers to objects of a Version</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#listlinkeddata|ListLinkedDataAsync]]</code></td><td>[[openapi:ListLinkedData]]</td><td>The linked data on a Version</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#reattachlink|ReattachLinkAsync]]</code></td><td>[[openapi:ReattachLink]]</td><td>Put a link on another object from a Version on</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#replacelinkeddata|ReplaceLinkedDataAsync]]</code></td><td>[[openapi:ReplaceLinkedData]]</td><td>Replace an item from a Version on</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#restorelinkeddata|RestoreLinkedDataAsync]]</code></td><td>[[openapi:RestoreLinkedData]]</td><td>Bring deleted items back</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#unlinkdata|UnlinkDataAsync]]</code></td><td>[[openapi:UnlinkData]]</td><td>Take links off their objects, on every Version</td></tr>
<tr><td><code>[[page:reference/sdk/dotnet/linkeddataapi#updatelinkeddata|UpdateLinkedDataAsync]]</code></td><td>[[openapi:UpdateLinkedData]]</td><td>Edit the title, description, category, validity or identifier system of an item</td></tr>
</tbody>
</table>

## `AddLinkTargetsAsync` {#addlinktargets}

```csharp
Task<IAddLinkTargetsApiResponse> AddLinkTargetsAsync(AddLinkTargetsRequest addLinkTargetsRequest, CancellationToken cancellationToken = default)
```

Link an existing item to more objects. The item is shared, never copied. A target the item is already linked to on that Version is left as it is. Needs read rights on the item and write rights on the model of `version_uuid`.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:AddLinkTargets]] · <code>POST /openapi/linkeddata/AddLinkTargets</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>addLinkTargetsRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#AddLinkTargetsRequest|AddLinkTargetsRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:AddLinkTargets]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkedDataLinks|LinkedDataLinks]]</code> — The item and the links made

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<AddLinkTargetsRequest>("""
    {
      "item_uuid": "00000000-0000-0000-0000-000000000000",
      "version_uuid": "BIM_WORKS_FIRST_MODEL",
      "targets": [
        {}
      ]
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().AddLinkTargetsAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `ConfirmLinkMatchAsync` {#confirmlinkmatch}

```csharp
Task<IConfirmLinkMatchApiResponse> ConfirmLinkMatchAsync(ConfirmLinkMatchRequest confirmLinkMatchRequest, CancellationToken cancellationToken = default)
```

Confirm that a link to check is on the right object. The check goes back to one pairing BIM.works was not sure of (an object matched by type and place after an upload, or the first of several objects with the link's GlobalId). That span becomes `CONFIRMED`, every later span the check stuck to becomes `OK`, and the pair is written as a compare pair override of the two Versions. `version_uuid` is a Version on which the link is marked `CHECK`. Needs write rights on the model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ConfirmLinkMatch]] · <code>POST /openapi/linkeddata/ConfirmLinkMatch</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>confirmLinkMatchRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#ConfirmLinkMatchRequest|ConfirmLinkMatchRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ConfirmLinkMatch]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#ConfirmLinkMatchResult|ConfirmLinkMatchResult]]</code> — The confirmed span and the link with its trail

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<ConfirmLinkMatchRequest>("""
    {
      "link_uuid": "00000000-0000-0000-0000-000000000000",
      "version_uuid": "BIM_WORKS_FIRST_MODEL"
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().ConfirmLinkMatchAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `DeleteLinkedDataAsync` {#deletelinkeddata}

```csharp
Task<IDeleteLinkedDataApiResponse> DeleteLinkedDataAsync(DeleteLinkedDataRequest deleteLinkedDataRequest, CancellationToken cancellationToken = default)
```

Delete items from every object and Version. Restorable for `retention_days`, after which the content is purged. Needs write rights on the item's model; the user who added an item may also delete it within 24 hours without them. An item already deleted is answered as deleted; nothing is changed when one is refused.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:DeleteLinkedData]] · <code>POST /openapi/linkeddata/DeleteLinkedData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>deleteLinkedDataRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#DeleteLinkedDataRequest|DeleteLinkedDataRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:DeleteLinkedData]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#DeleteLinkedDataResult|DeleteLinkedDataResult]]</code> — The items deleted

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<DeleteLinkedDataRequest>("""
    {
      "item_uuids": [
        "00000000-0000-0000-0000-000000000000"
      ],
      "reason": ""
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().DeleteLinkedDataAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `DownloadLinkedDataAsync` {#downloadlinkeddata}

```csharp
Task<IDownloadLinkedDataApiResponse> DownloadLinkedDataAsync(DownloadLinkedDataRequest downloadLinkedDataRequest, CancellationToken cancellationToken = default)
```

The content of one item, as uploaded. `delivery: stream` (the default) answers the content as the body: a file byte for byte as uploaded, with its media type and file name; a text whole; a URL or an identifier as text/plain. `X-BimWorks-Sha256` carries the SHA-256 of a file or long text, `ETag` the same quoted.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:DownloadLinkedData]] · <code>POST /openapi/linkeddata/DownloadLinkedData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>downloadLinkedDataRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#DownloadLinkedDataRequest|DownloadLinkedDataRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:DownloadLinkedData]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>Stream</code> — The content

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<DownloadLinkedDataRequest>("""
    {
      "item_uuid": "00000000-0000-0000-0000-000000000000",
      "delivery": "stream",
      "disposition": "attachment"
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().DownloadLinkedDataAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
using var output = File.Create("null");
await result.CopyToAsync(output);
```

## `EndLinkAsync` {#endlink}

```csharp
Task<IEndLinkApiResponse> EndLinkAsync(EndLinkRequest endLinkRequest, CancellationToken cancellationToken = default)
```

End a link from a Version on. The link stays on the older Versions and is neither shown nor followed from `from_version_uuid` on; unlike UnlinkData, the older Versions keep it. The Version must come after the one the link was made on (unlink it otherwise). Needs write rights on the model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:EndLink]] · <code>POST /openapi/linkeddata/EndLink</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>endLinkRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#EndLinkRequest|EndLinkRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:EndLink]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkedDataLinkResult|LinkedDataLinkResult]]</code> — The link with its trail

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<EndLinkRequest>("""
    {
      "link_uuid": "00000000-0000-0000-0000-000000000000",
      "from_version_uuid": "00000000-0000-0000-0000-000000000000"
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().EndLinkAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `GetLinkedDataAsync` {#getlinkeddata}

```csharp
Task<IGetLinkedDataApiResponse> GetLinkedDataAsync(GetLinkedDataRequest getLinkedDataRequest, CancellationToken cancellationToken = default)
```

One item with its links and their trail across Versions. The item with every field, the links on the models the caller can read, and per link the spans of Versions it was followed over, oldest first. A deleted item is answered too, so it can be restored. With `version_uuid` the model is followed up to that Version first. `replaces` and `replaced_by` name the items of a replacement (ReplaceLinkedData), both ways.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetLinkedData]] · <code>POST /openapi/linkeddata/GetLinkedData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>getLinkedDataRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#GetLinkedDataRequest|GetLinkedDataRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetLinkedData]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkedDataDetails|LinkedDataDetails]]</code> — The item, its links and its replacements

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<GetLinkedDataRequest>("""
    {
      "item_uuid": "00000000-0000-0000-0000-000000000000",
      "version_uuid": "BIM_WORKS_FIRST_MODEL"
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().GetLinkedDataAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `GetLinkedDataCountsAsync` {#getlinkeddatacounts}

```csharp
Task<IGetLinkedDataCountsApiResponse> GetLinkedDataCountsAsync(GetLinkedDataCountsRequest getLinkedDataCountsRequest, CancellationToken cancellationToken = default)
```

Which objects of a Version have linked data. For colouring and markers in a viewer. What is on an object is what ListLinkedData shows there. The objects, those with a link to check, the objects per file family, one marker per object (its item count, the family most of its items have) and the Version's totals. `include_later` adds the objects whose only links were made on later Versions (`later`), never counted in the totals. Needs read rights on the model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetLinkedDataCounts]] · <code>POST /openapi/linkeddata/GetLinkedDataCounts</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>getLinkedDataCountsRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#GetLinkedDataCountsRequest|GetLinkedDataCountsRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetLinkedDataCounts]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkedDataCounts|LinkedDataCounts]]</code> — The objects with linked data

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<GetLinkedDataCountsRequest>("""
    {
      "version_uuid": "BIM_WORKS_FIRST_MODEL",
      "include_later": false
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().GetLinkedDataCountsAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `GetLinkedDataPolicyAsync` {#getlinkeddatapolicy}

```csharp
Task<IGetLinkedDataPolicyApiResponse> GetLinkedDataPolicyAsync(CancellationToken cancellationToken = default)
```

What this server accepts as linked data. The file families with their allowed extensions, the extensions that are never accepted, the limits, the categories, the identifier systems and the URL schemes of this server. A client builds its file picker and its messages from it, so a file that would be refused is explained before it is sent.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetLinkedDataPolicy]] · <code>POST /openapi/linkeddata/GetLinkedDataPolicy</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:read]]</td></tr>
</tbody>
</table>

### Parameters

None: the operation takes no request.

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkedDataPolicy|LinkedDataPolicy]]</code> — The policy

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
// (GetLinkedDataPolicy takes no request)

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().GetLinkedDataPolicyAsync();

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `LinkDataAsync` {#linkdata}

```csharp
Task<ILinkDataApiResponse> LinkDataAsync(string request, Option<List<FileParameter>> file = default, CancellationToken cancellationToken = default)
```

Link files, URLs, texts or identifiers to objects of a Version. Creates one item per entry of `items` in the JSON `request` part and links each item to every target. The files are the `file` parts, in the order of the `items` entries whose kind is `FILE` (an entry may name its part by position with `stream` instead); an entry without a `filename` takes the part's file name. No new Version is made: each link follows its object to the later Versions of the model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:LinkData]] · <code>POST /openapi/linkeddata/LinkData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>request</code></td><td><code>string</code><span class="req">required</span></td><td>A JSON-encoded LinkDataSpec (<code>version_uuid</code>, <code>targets</code>, <code>items</code>)</td></tr>
<tr><td><code>file</code></td><td><code>List&lt;FileParameter&gt;</code><span class="opt">optional</span></td><td>The files, in the order of the FILE items</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkDataResult|LinkDataResult]]</code> — One entry per item, linked or refused

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = """
    {
      "version_uuid": "BIM_WORKS_FIRST_MODEL",
      "targets": [
        {}
      ],
      "items": [
        {
          "kind": "URL"
        }
      ]
    }
    """;

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().LinkDataAsync(request: request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `ListLinkedDataAsync` {#listlinkeddata}

```csharp
Task<IListLinkedDataApiResponse> ListLinkedDataAsync(ListLinkedDataRequest listLinkedDataRequest, CancellationToken cancellationToken = default)
```

The linked data on a Version. Every link shown on the Version, or only those on some objects, with the items they link. The links of the model are followed up to the Version first, so the answer is never out of date. `items` holds each item once; `links` one entry per object, with `oid_here`, how the link was found there (`how`) and its `state`.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListLinkedData]] · <code>POST /openapi/linkeddata/ListLinkedData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>listLinkedDataRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#ListLinkedDataRequest|ListLinkedDataRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListLinkedData]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkedDataList|LinkedDataList]]</code> — The items and the links on the Version

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<ListLinkedDataRequest>("""
    {
      "version_uuid": "BIM_WORKS_FIRST_MODEL",
      "oids": [
        0
      ],
      "qids": [
        ""
      ],
      "include_orphaned": false,
      "include_deleted": false,
      "with_objects": false,
      "include_later": false,
      "kinds": [
        "URL"
      ],
      "categories": [
        ""
      ]
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().ListLinkedDataAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `ReattachLinkAsync` {#reattachlink}

```csharp
Task<IReattachLinkApiResponse> ReattachLinkAsync(ReattachLinkRequest reattachLinkRequest, CancellationToken cancellationToken = default)
```

Put a link on another object from a Version on. The older Versions keep the object they had. From `version_uuid` on the link is on `target` (`REATTACHED`, `OK`), follows that object's GlobalId to later uploads, and the newer Versions are followed again from there. On the Version the link was made on, it corrects the object the link was made on. Needs write rights on the model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ReattachLink]] · <code>POST /openapi/linkeddata/ReattachLink</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>reattachLinkRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#ReattachLinkRequest|ReattachLinkRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ReattachLink]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkedDataLinkResult|LinkedDataLinkResult]]</code> — The link with its trail

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<ReattachLinkRequest>("""
    {
      "link_uuid": "00000000-0000-0000-0000-000000000000",
      "version_uuid": "BIM_WORKS_FIRST_MODEL",
      "target": {}
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().ReattachLinkAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `ReplaceLinkedDataAsync` {#replacelinkeddata}

```csharp
Task<IReplaceLinkedDataApiResponse> ReplaceLinkedDataAsync(string request, Option<FileParameter> file = default, CancellationToken cancellationToken = default)
```

Replace an item from a Version on. A new datasheet for a pump that was swapped in v12: one call adds the new item (`item` of the JSON `request` part, as an item of LinkData; a FILE is the `file` part), linked from `from_version_uuid` on to the objects the old item is on there, and ends the old item's links from that Version, so the older Versions keep the old one. A link the old item got on that very Version is taken off (`unlinked`), and when that was all of the old item, it is deleted (`deleted`, restorable). The new item names the one it replaces (`replaces_item_uuid`; GetLinkedData answers both ways). Only the links on the model of `from_version_uuid` are replaced. Needs write rights on the model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ReplaceLinkedData]] · <code>POST /openapi/linkeddata/ReplaceLinkedData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>request</code></td><td><code>string</code><span class="req">required</span></td><td>A JSON-encoded ReplaceLinkedDataSpec (<code>item_uuid</code>, <code>from_version_uuid</code>, <code>item</code>)</td></tr>
<tr><td><code>file</code></td><td><code>FileParameter</code><span class="opt">optional</span></td><td>The file. The new file, when the new item is a FILE</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#ReplaceLinkedDataResult|ReplaceLinkedDataResult]]</code> — The new item and its links, and what happened to the old one's

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = """
    {
      "item_uuid": "00000000-0000-0000-0000-000000000000",
      "from_version_uuid": "00000000-0000-0000-0000-000000000000",
      "item": {
        "kind": "URL"
      }
    }
    """;
var file = new FileParameter(File.OpenRead("drawing.pdf"), "drawing.pdf");

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().ReplaceLinkedDataAsync(request: request, file: file);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `RestoreLinkedDataAsync` {#restorelinkeddata}

```csharp
Task<IRestoreLinkedDataApiResponse> RestoreLinkedDataAsync(RestoreLinkedDataRequest restoreLinkedDataRequest, CancellationToken cancellationToken = default)
```

Bring deleted items back. Their links were kept; they show again where they were. 410 `RETENTION_PASSED` when an item was deleted longer ago than the retention period. Needs write rights on the item's model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:RestoreLinkedData]] · <code>POST /openapi/linkeddata/RestoreLinkedData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>restoreLinkedDataRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#RestoreLinkedDataRequest|RestoreLinkedDataRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:RestoreLinkedData]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#RestoreLinkedDataResult|RestoreLinkedDataResult]]</code> — The items restored

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<RestoreLinkedDataRequest>("""
    {
      "item_uuids": [
        "00000000-0000-0000-0000-000000000000"
      ]
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().RestoreLinkedDataAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `UnlinkDataAsync` {#unlinkdata}

```csharp
Task<IUnlinkDataApiResponse> UnlinkDataAsync(UnlinkDataRequest unlinkDataRequest, CancellationToken cancellationToken = default)
```

Take links off their objects, on every Version. An item that would lose its last link is deleted instead (it can be restored, back on that object). Needs write rights on each link's model; nothing is changed when one is refused.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:UnlinkData]] · <code>POST /openapi/linkeddata/UnlinkData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>unlinkDataRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#UnlinkDataRequest|UnlinkDataRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:UnlinkData]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#UnlinkDataResult|UnlinkDataResult]]</code> — The links taken off, and the items deleted because they lost their last link

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<UnlinkDataRequest>("""
    {
      "link_uuids": [
        "00000000-0000-0000-0000-000000000000"
      ]
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().UnlinkDataAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```

## `UpdateLinkedDataAsync` {#updatelinkeddata}

```csharp
Task<IUpdateLinkedDataApiResponse> UpdateLinkedDataAsync(UpdateLinkedDataRequest updateLinkedDataRequest, CancellationToken cancellationToken = default)
```

Edit the title, description, category, validity or identifier system of an item. The content never changes; a new file is a new item. Send the `row_version` you read; a stale one answers 409 `VERSION_CONFLICT`, naming who changed the item. An absent field keeps its value, an empty string clears it (the title falls back to the file name). Needs write rights on the item's model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:UpdateLinkedData]] · <code>POST /openapi/linkeddata/UpdateLinkedData</code></td></tr>
<tr><th>Scope</th><td>[[scope:links:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>updateLinkedDataRequest</code></td><td><code>[[page:reference/sdk/dotnet/models#UpdateLinkedDataRequest|UpdateLinkedDataRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:UpdateLinkedData]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/dotnet/models#LinkedDataItem|LinkedDataItem]]</code> — The item as it is now

### Example

```csharp
using System.Text.Json;
using BIMworks.Sdk.Api;
using BIMworks.Sdk.Client;
using BIMworks.Sdk.Extensions;
using BIMworks.Sdk.Model;
using Microsoft.Extensions.DependencyInjection;

// 1. Connect to BIM.works and log in with your API token
IServiceProvider Connect(string bearer)
{
    var services = new ServiceCollection();
    services.AddApi(options =>
    {
        options.AddTokens(new BearerToken(bearer));
        options.AddApiHttpClients(http =>
        {
            http.BaseAddress = new Uri("BIM_WORKS_ADDRESS" + "/openapi");
            http.Timeout = Timeout.InfiniteTimeSpan;
        });
    });
    return services.BuildServiceProvider();
}
var login = await Connect("").GetRequiredService<IAuthApi>().LoginWithApiTokenAsync(new LoginWithApiTokenRequest("BIM_WORKS_API_TOKEN"));
var auth = login.Ok()?.Auth ?? throw new HttpRequestException(login.RawContent, null, login.StatusCode);
var client = Connect(auth.Base64);
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

// 2. The request
var request = JsonSerializer.Deserialize<UpdateLinkedDataRequest>("""
    {
      "item_uuid": "00000000-0000-0000-0000-000000000000",
      "row_version": 0,
      "title": "",
      "description": "",
      "category": "",
      "valid_until": "",
      "identifier_system": ""
    }
    """, json);

// 3. The call
var response = await client.GetRequiredService<ILinkedDataApi>().UpdateLinkedDataAsync(request);

// 4. The result
var result = response.Ok() ?? throw new HttpRequestException(response.RawContent, null, response.StatusCode);
Console.WriteLine(JsonSerializer.Serialize(result, json));
```
