---
title: VersionsApi
summary: Java SDK: the Versions operations, 1 method, each with its parameters, result and a complete example.
order: 23
languages: [java]
sdk-package: Java SDK · nl.bimbase.bimworks.sdk
link-terms: true
---

# VersionsApi

[[page:reference/sdk/java|Java SDK]] · `nl.bimbase.bimworks.sdk.api` · class · 1 method

Calls related to Versions

Construct it with the client of [[page:reference/sdk/java#connect|the connect step]]: `new VersionsApi(client)`. 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/java/versionsapi#version|version]]</code></td><td>[[openapi:Version]]</td><td>The metadata of a Version by its UUID (deprecated, use GetVersion, or Download for the file)</td></tr>
</tbody>
</table>

## `version` {#version}

```java
public ModelVersion version(UUID uuid) throws ApiException
```

The metadata of a Version by its UUID (deprecated, use GetVersion, or Download for the file). Deprecated, this operation will be removed in a later release. Earlier versions of this specification said it answers the file of the Version; it answers the Version's metadata as JSON, the same as GetVersion. For the file, use Download. The binary content types are listed only so that the Accept header of older generated clients still matches; the body is always the JSON.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:Version]] · <code>GET /openapi/Versions/{uuid}</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs: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>uuid</code></td><td><code>UUID</code><span class="req">required</span></td><td></td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#ModelVersion|ModelVersion]]</code> — The metadata of this Version

### Example

```java
import java.util.UUID;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.VersionsApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        UUID uuid = UUID.fromString("BIM_WORKS_FIRST_MODEL");

        // 3. The call
        var result = new VersionsApi(client).version(uuid);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```
