---
title: ModelApi
summary: Java SDK: the Model operations, 12 methods, each with its parameters, result and a complete example.
order: 12
languages: [java]
sdk-package: Java SDK · nl.bimbase.bimworks.sdk
link-terms: true
---

# ModelApi

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

Calls related to models, for example to upload or download models

Construct it with the client of [[page:reference/sdk/java#connect|the connect step]]: `new ModelApi(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/modelapi#addmodelwithurl|addModelWithUrl]]</code></td><td>[[openapi:AddModelWithUrl]]</td><td>Add a new model by providing a URL</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#augmentbcf|augmentBcf]]</code></td><td>[[openapi:AugmentBcf]]</td><td>Add snapshots to a BCF</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#download|download]]</code></td><td>[[openapi:Download]]</td><td>Download the model of the given Version UUID, as uploaded or as IFC or ifcXML.</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#downloadifcxml|downloadIfcXml]]</code></td><td>[[openapi:DownloadIfcXml]]</td><td>Download the model of the given Version UUID serialized as ifcXML (deprecated, use Download with format ifcxml)</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#exportgeometry|exportGeometry]]</code></td><td>[[openapi:ExportGeometry]]</td><td>The geometry of models as glTF</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#exportvectorsvg|exportVectorSvg]]</code></td><td>[[openapi:ExportVectorSvg]]</td><td>Export an orthographic vector drawing (SVG) of a model</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#getcheckin|getCheckin]]</code></td><td>[[openapi:GetCheckin]]</td><td>The status of a checkin</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#getvalidationreport|getValidationReport]]</code></td><td>[[openapi:GetValidationReport]]</td><td>Why a model is invalid, or why its checkin failed</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#lookupmodelhashes|lookupModelHashes]]</code></td><td>[[openapi:LookupModelHashes]]</td><td>Which files the server has already</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#render|render]]</code></td><td>[[openapi:Render]]</td><td>A PNG image of a model</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#schemaconversionreport|schemaConversionReport]]</code></td><td>[[openapi:SchemaConversionReport]]</td><td>The log of a schema conversion</td></tr>
<tr><td><code>[[page:reference/sdk/java/modelapi#uploadmodel|uploadModel]]</code></td><td>[[openapi:UploadModel]]</td><td>Upload a single model using multipart/form-data</td></tr>
</tbody>
</table>

## `addModelWithUrl` {#addmodelwithurl}

```java
public ModelVersion addModelWithUrl(AddModelWithUrlRequest addModelWithUrlRequest) throws ApiException
```

Add a new model by providing a URL. The server fetches the file from `url` (within its egress policy) and checks it in under `node_uuid`. The checkin (parsing, geometry, indexing) follows the upload, which is always waited for. Without `wait_ms` the call answers when the checkin ends, with the new Version, which for a big model can take longer than a gateway waits. With `wait_ms` it answers the Version when the checkin ends within that many milliseconds, and otherwise 202 with the checkin's status and `job_uuid`: follow it with GetCheckin. A checkin still running after an hour answers 202 too. A ZIP of models is checked in where it was received and has no job, so it always waits. The same file name in the same folder adds a Version to that model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:AddModelWithUrl]] · <code>POST /openapi/model/AddModelWithUrl</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:upload]]</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>addModelWithUrlRequest</code></td><td><code>[[page:reference/sdk/java/models#AddModelWithUrlRequest|AddModelWithUrlRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:AddModelWithUrl]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#ModelVersion|ModelVersion]]</code> — Upload was successful

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.AddModelWithUrlRequest;
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
        AddModelWithUrlRequest request = client.getObjectMapper().readValue("""
                {
                  "node_uuid": "00000000-0000-0000-0000-000000000000",
                  "path": "",
                  "filename": "",
                  "url": "",
                  "input_file_type": "IFC",
                  "format_settings": {},
                  "force_reprocessing": false,
                  "tags": [
                    "DEMO"
                  ],
                  "validation_settings": {},
                  "wait_ms": 0,
                  "force": "NONE"
                }
                """, AddModelWithUrlRequest.class);

        // 3. The call
        var result = new ModelApi(client).addModelWithUrl(request);

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

## `augmentBcf` {#augmentbcf}

```java
public File augmentBcf(File bcf, UUID versionUuid, Integer width, Integer height) throws ApiException
```

Add snapshots to a BCF. Answers the BCF 2.1 file with a PNG snapshot rendered for each viewpoint that has a perspective camera, of the model `version_uuid`: an integrator keeps its issues and gets BCF with images out of them. Orthogonal viewpoints keep what they had; at most 1000 snapshots are rendered per file.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:AugmentBcf]] · <code>POST /openapi/model/AugmentBcf</code></td></tr>
<tr><th>Scope</th><td>[[scope:geometry: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>bcf</code></td><td><code>File</code><span class="req">required</span></td><td>The file. The BCF 2.1 file</td></tr>
<tr><td><code>versionUuid</code></td><td><code>UUID</code><span class="req">required</span></td><td></td></tr>
<tr><td><code>width</code></td><td><code>Integer</code><span class="opt">optional</span></td><td>The snapshots' width in pixels, 300 when absent</td></tr>
<tr><td><code>height</code></td><td><code>Integer</code><span class="opt">optional</span></td><td>The snapshots' height in pixels, 300 when absent</td></tr>
</tbody>
</table>

### Returns

<code>File</code> — The BCF with the snapshots

### Example

```java
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.UUID;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
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
        File bcf = new File("issues.bcf");
        UUID versionUuid = UUID.fromString("BIM_WORKS_FIRST_MODEL");

        // 3. The call
        var result = new ModelApi(client).augmentBcf(bcf, versionUuid, null, null);

        // 4. The result
        Files.move(result.toPath(), Path.of("augment-bcf.bcf"), StandardCopyOption.REPLACE_EXISTING);
    }
}
```

## `download` {#download}

```java
public File download(DownloadRequest downloadRequest) throws ApiException
```

Download the model of the given Version UUID, as uploaded or as IFC or ifcXML. In case you want to download only a subset of an IFC model, use ifc/query. `format` chooses what comes back; it wins over the Accept header, which is not read by this operation. `original` (the default) is the file as it was uploaded, byte for byte; `ifc` and `ifcxml` serialize the stored model, so they work for any Version whose model parsed as IFC, whatever its upload encoding. With `error_uuid` instead of a model identifier the file of a failed upload comes back as it was uploaded.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:Download]] · <code>POST /openapi/model/Download</code></td></tr>
<tr><th>Scope</th><td>[[scope:model: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>downloadRequest</code></td><td><code>[[page:reference/sdk/java/models#DownloadRequest|DownloadRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:Download]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>File</code> — The model file. Without target_schema byte-for-byte as it was uploaded, with target_schema the converted file

### Example

```java
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.DownloadRequest;
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
        DownloadRequest request = client.getObjectMapper().readValue("""
                {
                  "type": "VersionModelIdentifier",
                  "uuid": "BIM_WORKS_FIRST_MODEL"
                }
                """, DownloadRequest.class);

        // 3. The call
        var result = new ModelApi(client).download(request);

        // 4. The result
        Files.move(result.toPath(), Path.of("download.ifc"), StandardCopyOption.REPLACE_EXISTING);
    }
}
```

## `downloadIfcXml` {#downloadifcxml}

```java
public File downloadIfcXml(ModelIdentifier modelIdentifier) throws ApiException
```

Download the model of the given Version UUID serialized as ifcXML (deprecated, use Download with format ifcxml). Deprecated, Download with `format` `ifcxml` answers the same file; this operation will be removed in a later release. The stored model is converted on the fly, so this works for any Version whose model parsed as IFC, regardless of the encoding it was uploaded in. The ifcXML dialect follows the model's schema, ISO 10303-28 for IFC2X3 and ifcXML4 for IFC4/IFC4X3.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:DownloadIfcXml]] · <code>POST /openapi/model/DownloadIfcXml</code></td></tr>
<tr><th>Scope</th><td>[[scope:model: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>modelIdentifier</code></td><td><code>[[page:reference/sdk/java/models#ModelIdentifier|ModelIdentifier]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:DownloadIfcXml]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>File</code> — The model serialized as ifcXML

### Example

```java
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.ModelIdentifier;

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
        ModelIdentifier request = client.getObjectMapper().readValue("""
                {
                  "type": "VersionModelIdentifier",
                  "uuid": "BIM_WORKS_FIRST_MODEL"
                }
                """, ModelIdentifier.class);

        // 3. The call
        var result = new ModelApi(client).downloadIfcXml(request);

        // 4. The result
        Files.move(result.toPath(), Path.of("download-ifc-xml.xml"), StandardCopyOption.REPLACE_EXISTING);
    }
}
```

## `exportGeometry` {#exportgeometry}

```java
public File exportGeometry(ExportGeometryRequest exportGeometryRequest) throws ApiException
```

The geometry of models as glTF. Exports the triangulated geometry of the objects a BQL condition selects (every product when absent) as one binary glTF file, several models in one file.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ExportGeometry]] · <code>POST /openapi/model/ExportGeometry</code></td></tr>
<tr><th>Scope</th><td>[[scope:geometry: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>exportGeometryRequest</code></td><td><code>[[page:reference/sdk/java/models#ExportGeometryRequest|ExportGeometryRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ExportGeometry]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>File</code> — The file

### Example

```java
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.ExportGeometryRequest;
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
        ExportGeometryRequest request = client.getObjectMapper().readValue("""
                {
                  "models": [
                    {
                      "type": "UrlModelIdentifier"
                    }
                  ],
                  "query": "",
                  "format": "glb",
                  "colors": {},
                  "only_outside_triangles": false
                }
                """, ExportGeometryRequest.class);

        // 3. The call
        var result = new ModelApi(client).exportGeometry(request);

        // 4. The result
        Files.move(result.toPath(), Path.of("export-geometry.glb"), StandardCopyOption.REPLACE_EXISTING);
    }
}
```

## `exportVectorSvg` {#exportvectorsvg}

```java
public File exportVectorSvg(ExportVectorSvgRequest exportVectorSvgRequest) throws ApiException
```

Export an orthographic vector drawing (SVG) of a model. Renders a floor plan, section or elevation of one model as an SVG drawing with occlusion culling (every product its own group), optionally restricted, recoloured and labelled through BQL and BVL. A request carrying `styling` also needs the actions:read scope. The response carries the drawing; the `cache` and `labels` objects of the task response are returned as the `X-BimWorks-Vector` header (JSON).

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ExportVectorSvg]] · <code>POST /openapi/model/ExportVectorSvg</code></td></tr>
<tr><th>Scope</th><td>[[scope:geometry: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>exportVectorSvgRequest</code></td><td><code>[[page:reference/sdk/java/models#ExportVectorSvgRequest|ExportVectorSvgRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ExportVectorSvg]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>File</code> — The drawing

### Example

```java
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.ExportVectorSvgRequest;
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
        ExportVectorSvgRequest request = client.getObjectMapper().readValue("""
                {}
                """, ExportVectorSvgRequest.class);

        // 3. The call
        var result = new ModelApi(client).exportVectorSvg(request);

        // 4. The result
        Files.move(result.toPath(), Path.of("export-vector-svg.svg"), StandardCopyOption.REPLACE_EXISTING);
    }
}
```

## `getCheckin` {#getcheckin}

```java
public CheckinStatus getCheckin(GetCheckinRequest getCheckinRequest) throws ApiException
```

The status of a checkin. The status of the checkin of an upload, by the `job_uuid` an upload answered with 202, or by the `version_uuid` it made. With `wait_ms` the call waits that long for the checkin to end (at most 5 minutes). Once it is DONE the answer holds the Version; once it FAILED, the error. Needs read rights on the model. Checkin jobs are kept for 30 days.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetCheckin]] · <code>POST /openapi/model/GetCheckin</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>getCheckinRequest</code></td><td><code>[[page:reference/sdk/java/models#GetCheckinRequest|GetCheckinRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetCheckin]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#CheckinStatus|CheckinStatus]]</code> — The status

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.GetCheckinRequest;
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
        GetCheckinRequest request = client.getObjectMapper().readValue("""
                {
                  "job_uuid": "00000000-0000-0000-0000-000000000000",
                  "version_uuid": "BIM_WORKS_FIRST_MODEL",
                  "wait_ms": 0
                }
                """, GetCheckinRequest.class);

        // 3. The call
        var result = new ModelApi(client).getCheckin(request);

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

## `getValidationReport` {#getvalidationreport}

```java
public ValidationReportResult getValidationReport(GetValidationReportRequest getValidationReportRequest) throws ApiException
```

Why a model is invalid, or why its checkin failed. The validation report of a Version (`model`) or of a failed checkin (`error_uuid`, from ListNodeErrors): per stage of the checkin (upload, parse, schemaCheck, geometry3d, geometry2d, indexing, ...) its status and its findings, each with its rule, severity and the object it is about. `summary_only` answers the counts.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetValidationReport]] · <code>POST /openapi/model/GetValidationReport</code></td></tr>
<tr><th>Scope</th><td>[[scope:query:run]]</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>getValidationReportRequest</code></td><td><code>[[page:reference/sdk/java/models#GetValidationReportRequest|GetValidationReportRequest]]</code><span class="opt">optional</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetValidationReport]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#ValidationReportResult|ValidationReportResult]]</code> — The report

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.GetValidationReportRequest;
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
        GetValidationReportRequest request = client.getObjectMapper().readValue("""
                {
                  "model": {
                    "type": "UrlModelIdentifier"
                  },
                  "error_uuid": "00000000-0000-0000-0000-000000000000",
                  "summary_only": false,
                  "min_severity": "INFO",
                  "stage": "",
                  "rule": [
                    ""
                  ],
                  "global_id": "",
                  "express_id": 0
                }
                """, GetValidationReportRequest.class);

        // 3. The call
        var result = new ModelApi(client).getValidationReport(request);

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

## `lookupModelHashes` {#lookupmodelhashes}

```java
public LookupModelHashes200Response lookupModelHashes(LookupModelHashesRequest lookupModelHashesRequest) throws ApiException
```

Which files the server has already. For each file, whether the server has processed one with the same content, so its upload can send the `hash` instead of the bytes (UploadModel). Hash the first 32 KiB and pass that with the size first, which is cheap; for the files that are known, hash the whole file and pass `full_xxh64`. The answer is in the order asked. `max_concurrent_checkins` is how many checkins the answering server runs at once: an upload scheduler keeps about that many uploads going.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:LookupModelHashes]] · <code>POST /openapi/model/LookupModelHashes</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:upload]]</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>lookupModelHashesRequest</code></td><td><code>[[page:reference/sdk/java/models#LookupModelHashesRequest|LookupModelHashesRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:LookupModelHashes]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#LookupModelHashes200Response|LookupModelHashes200Response]]</code> — Per file whether it is known

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.LookupModelHashesRequest;

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
        LookupModelHashesRequest request = client.getObjectMapper().readValue("""
                {
                  "models": [
                    {
                      "size": 1048576,
                      "partial_xxh64": 12345678901234567890
                    }
                  ]
                }
                """, LookupModelHashesRequest.class);

        // 3. The call
        var result = new ModelApi(client).lookupModelHashes(request);

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

## `render` {#render}

```java
public File render(RenderRequest renderRequest) throws ApiException
```

A PNG image of a model. Renders one model as a PNG. With `camera` it shows that view; with `view` one of the named angles, framing the whole model. With neither it answers the screenshot the checkin stored, or else the `iso_front_right` view. A workspace whose filter limits the objects gets no image of the whole model. Rendering must be enabled on the instance; a host without a GPU renders on the CPU.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:Render]] · <code>POST /openapi/model/Render</code></td></tr>
<tr><th>Scope</th><td>[[scope:geometry: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>renderRequest</code></td><td><code>[[page:reference/sdk/java/models#RenderRequest|RenderRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:Render]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>File</code> — The image

### Example

```java
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.RenderRequest;

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
        RenderRequest request = client.getObjectMapper().readValue("""
                {
                  "model": {
                    "type": "UrlModelIdentifier"
                  },
                  "camera": {
                    "position": {
                      "x": 0.0,
                      "y": 0.0,
                      "z": 0.0
                    }
                  },
                  "view": "iso_front_right",
                  "size": {}
                }
                """, RenderRequest.class);

        // 3. The call
        var result = new ModelApi(client).render(request);

        // 4. The result
        Files.move(result.toPath(), Path.of("render.png"), StandardCopyOption.REPLACE_EXISTING);
    }
}
```

## `schemaConversionReport` {#schemaconversionreport}

```java
public SchemaConversionReportResponse schemaConversionReport(SchemaConversionReportRequest schemaConversionReportRequest) throws ApiException
```

The log of a schema conversion. What a schema conversion lost, added and changed. For a Version that was made by the statement CONVERT SCHEMA pass its identifier; for a converted download pass the identifier of the Version that was downloaded and the target_schema it was converted to. This call reads a log, it converts nothing; a conversion that was never made is not found. The report holds the summary, exact counters per rule and a capped number of findings per rule. Every single loss and addition is in the detail log, which is never capped.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:SchemaConversionReport]] · <code>POST /openapi/model/SchemaConversionReport</code></td></tr>
<tr><th>Scope</th><td>[[scope:model: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>schemaConversionReportRequest</code></td><td><code>[[page:reference/sdk/java/models#SchemaConversionReportRequest|SchemaConversionReportRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:SchemaConversionReport]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#SchemaConversionReportResponse|SchemaConversionReportResponse]]</code> — The conversion report in the requested format

### Example

```java
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;
import nl.bimbase.bimworks.sdk.model.SchemaConversionReportRequest;

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
        SchemaConversionReportRequest request = client.getObjectMapper().readValue("""
                {
                  "type": "VersionModelIdentifier",
                  "uuid": "BIM_WORKS_FIRST_MODEL",
                  "target_schema": "IFC4"
                }
                """, SchemaConversionReportRequest.class);

        // 3. The call
        var result = new ModelApi(client).schemaConversionReport(request);

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

## `uploadModel` {#uploadmodel}

```java
public ModelVersion uploadModel(File _file, UUID nodeUuid, String filename, Long filesize, String contentType, String inputFileType, String formatSettings, String hash, Boolean forceReprocessing, String tags, String validationSettings, Long waitMs, String force) throws ApiException
```

Upload a single model using multipart/form-data. Uploads a file into the folder `node_uuid` (the caller's own root when absent). When LookupModelHashes says the server has the file already, send its `hash` instead of the `file` part: no bytes travel. A hash the server cannot use after all answers NO_STREAM (404); send the file then. The checkin (parsing, geometry, indexing) follows the upload, which is always waited for. Without `wait_ms` the call answers when the checkin ends, with the new Version, which for a big model can take longer than a gateway waits. With `wait_ms` it answers the Version when the checkin ends within that many milliseconds, and otherwise 202 with the checkin's status and `job_uuid`: follow it with GetCheckin. A checkin still running after an hour answers 202 too. A ZIP of models is checked in where it was received and has no job, so it always waits. The same file name in the same folder adds a Version to that model.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:UploadModel]] · <code>POST /openapi/model/UploadModel</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:upload]]</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>_file</code></td><td><code>File</code><span class="opt">optional</span></td><td>The file. A single uploaded model</td></tr>
<tr><td><code>nodeUuid</code></td><td><code>UUID</code><span class="opt">optional</span></td><td>The UUID of the Node to which to add the models</td></tr>
<tr><td><code>filename</code></td><td><code>String</code><span class="opt">optional</span></td><td>Name of the file</td></tr>
<tr><td><code>filesize</code></td><td><code>Long</code><span class="opt">optional</span></td><td>Filesize in bytes</td></tr>
<tr><td><code>contentType</code></td><td><code>String</code><span class="opt">optional</span></td><td>The content type. When available this information is taken from the Content-Type of the file part. Allowed values are application/ifc, application/xml (for .ifcxml files), application/pdf, application/e57</td></tr>
<tr><td><code>inputFileType</code></td><td><code>String</code><span class="opt">optional</span></td><td>The type of the model (an InputFileType name). When present and not UNKNOWN it wins over the filename extension</td></tr>
<tr><td><code>formatSettings</code></td><td><code>String</code><span class="opt">optional</span></td><td>A JSON-encoded PointCloudFormatSettings object (multipart form fields are strings) with per-upload point cloud format options</td></tr>
<tr><td><code>hash</code></td><td><code>String</code><span class="opt">optional</span></td><td>Instead of the file, its full_xxh64 (see ModelHash) when LookupModelHashes said the server knows it; ignored next to a file, which the server hashes itself. Needs filename</td></tr>
<tr><td><code>forceReprocessing</code></td><td><code>Boolean</code><span class="opt">optional</span></td><td>Process the file again, also when the server has processed the same file before</td></tr>
<tr><td><code>tags</code></td><td><code>String</code><span class="opt">optional</span></td><td>Tags of the new Version, comma-separated VersionTag names</td></tr>
<tr><td><code>validationSettings</code></td><td><code>String</code><span class="opt">optional</span></td><td>A JSON-encoded ValidationSettings object</td></tr>
<tr><td><code>waitMs</code></td><td><code>Long</code><span class="opt">optional</span></td><td>Answer 202 with the checkin's status when the checkin takes longer than this</td></tr>
<tr><td><code>force</code></td><td><code>String</code><span class="opt">optional</span></td><td>An UploadForce: NONE, NEW_VERSION or NEW_MODEL</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/java/models#ModelVersion|ModelVersion]]</code> — Upload was successful

### Example

```java
import java.io.File;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.api.ModelApi;
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
        File _file = new File("model.ifc");
        String filename = "model.ifc";

        // 3. The call
        var result = new ModelApi(client).uploadModel(_file, null, filename, null, null, null, null, null, null, null, null, null, null);

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