Reference·Java SDK · nl.bimbase.bimworks.sdkJava

VersionsApi

Java SDK: the Versions operations, 1 method, each with its parameters, result and a complete example.

Java SDK · nl.bimbase.bimworks.sdk.api · class · 1 method

Calls related to Versions

Construct it with the client of the connect step: new VersionsApi(client). Each method is one operation of the API part, where it runs on its page.

MethodOperationDescription
versionVersionThe metadata of a Version by its UUID (deprecated, use GetVersion, or Download for the file)

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.

OperationVersion · GET /openapi/Versions/{uuid}
Scopefs:read

Parameters#

NameTypeDescription
uuidUUIDrequired

Returns#

ModelVersion — 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("https://bim.works/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("<your API token>"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        UUID uuid = UUID.fromString("<version uuid of the first demo model>");

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

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