Reference·TypeScript SDK · @bimworks/sdkTypeScript

VersionsApi

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

TypeScript SDK · @bimworks/sdk · 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#

TypeScript#
version(requestParameters: { uuid: string }): Promise<ModelVersion>

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
uuidstringrequired

Returns#

ModelVersion — The metadata of this Version

Example#

TypeScript#
import { AuthApi, Configuration, ModelVersionToJSON, VersionsApi } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "https://bim.works/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "<your API token>" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = { uuid: "<version uuid of the first demo model>" };

// 3. The call
const result = await new VersionsApi(client).version(request);

// 4. The result
console.log(JSON.stringify(ModelVersionToJSON(result), null, 2));