VersionsApi
PHP SDK: the Versions operations, 1 method, each with its parameters, result and a complete example.
PHP SDK · BIMworks\Api · class · 1 method
Calls related to Versions
Construct it with the client of the connect step: new VersionsApi(config: $client). Each method is one operation of the API part, where it runs on its page.
| Method | Operation | Description |
|---|---|---|
version | Version | The metadata of a Version by its UUID (deprecated, use GetVersion, or Download for the file) |
version#
public function version(string $uuid): ModelVersionThe 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.
| Operation | Version · GET /openapi/Versions/{uuid} |
|---|---|
| Scope | fs:read |
Parameters#
| Name | Type | Description |
|---|---|---|
uuid | stringrequired |
Returns#
ModelVersion — The metadata of this Version
Example#
<?php
require __DIR__ . '/vendor/autoload.php';
use BIMworks\Api\AuthApi;
use BIMworks\Api\VersionsApi;
use BIMworks\Configuration;
use BIMworks\Model\LoginWithApiTokenRequest;
// 1. Connect to BIM.works and log in with your API token
$client = (new Configuration())->setHost('https://bim.works/openapi');
$auth = (new AuthApi(config: $client))->loginWithApiToken(new LoginWithApiTokenRequest(['token' => "<your API token>"]));
$client->setAccessToken($auth->getBase64());
// 2. The request
$request = ['uuid' => "<version uuid of the first demo model>"];
// 3. The call
$result = (new VersionsApi(config: $client))->version(...$request);
// 4. The result
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), PHP_EOL;