---
title: InfoApi
summary: .NET SDK: the Info operations, 1 method, each with its parameters, result and a complete example.
order: 19
languages: [csharp]
sdk-package: .NET SDK · BIMworks.Sdk
link-terms: true
---

# InfoApi

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

General information about the instance

Construct it with the client of [[page:reference/sdk/dotnet#connect|the connect step]]: `client.GetRequiredService<IInfoApi>()`. 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/infoapi#getapplicationversion|GetApplicationVersionAsync]]</code></td><td>[[openapi:GetApplicationVersion]]</td><td>The BIM.works version of the instance</td></tr>
</tbody>
</table>

## `GetApplicationVersionAsync` {#getapplicationversion}

```csharp
Task<IGetApplicationVersionApiResponse> GetApplicationVersionAsync(CancellationToken cancellationToken = default)
```

The BIM.works version of the instance. The version of BIM.works the instance runs, to check compatibility. No credential needed.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetApplicationVersion]] · <code>POST /openapi/info/GetApplicationVersion</code></td></tr>
<tr><th>Scope</th><td>none: callable before logging in</td></tr>
</tbody>
</table>

### Parameters

None: the operation takes no request.

### Returns

<code>[[page:reference/sdk/dotnet/models#GetApplicationVersion200Response|GetApplicationVersion200Response]]</code> — 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 (GetApplicationVersion needs no login)
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 client = Connect("");
var json = client.GetRequiredService<JsonSerializerOptionsProvider>().Options;

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

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

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