Reference·Python SDK · bimworksPython

VersionsApi

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

Python SDK · bimworks · class · 1 method

Calls related to Versions

Construct it with the client of the connect step: bimworks.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#

Python#
def version(self, uuid: UUID) -> 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
uuidUUIDrequired

Returns#

ModelVersion — The metadata of this Version

Example#

Python#
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="https://bim.works/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="<your API token>"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
uuid = "<version uuid of the first demo model>"

# 3. The call
result = bimworks.VersionsApi(client).version(uuid=uuid)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))