Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Latest commit

 

History

History
313 lines (213 loc) · 11.7 KB

VersionsApi.md

File metadata and controls

313 lines (213 loc) · 11.7 KB

Autodesk\Forge\Client\VersionsApi

All URIs are relative to https://developer.api.autodesk.com

Method HTTP request Description
getVersion GET /data/v1/projects/{project_id}/versions/{version_id}
getVersionItem GET /data/v1/projects/{project_id}/versions/{version_id}/item
getVersionRefs GET /data/v1/projects/{project_id}/versions/{version_id}/refs
getVersionRelationshipsRefs GET /data/v1/projects/{project_id}/versions/{version_id}/relationships/refs
postVersion POST /data/v1/projects/{project_id}/versions
postVersionRelationshipsRef POST /data/v1/projects/{project_id}/versions/{version_id}/relationships/refs

getVersion

\Autodesk\Forge\Client\Model\Version getVersion($project_id, $version_id)

Returns the version with the given version_id.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Autodesk\Forge\Client\Api\VersionsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$version_id = "version_id_example"; // string | the `version id`

try {
    $result = $apiInstance->getVersion($project_id, $version_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VersionsApi->getVersion: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
version_id string the `version id`

Return type

\Autodesk\Forge\Client\Model\Version

Authorization

oauth2_access_code

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getVersionItem

\Autodesk\Forge\Client\Model\Item getVersionItem($project_id, $version_id)

Returns the item the given version is associated with.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Autodesk\Forge\Client\Api\VersionsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$version_id = "version_id_example"; // string | the `version id`

try {
    $result = $apiInstance->getVersionItem($project_id, $version_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VersionsApi->getVersionItem: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
version_id string the `version id`

Return type

\Autodesk\Forge\Client\Model\Item

Authorization

oauth2_access_code

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getVersionRefs

\Autodesk\Forge\Client\Model\JsonApiCollection getVersionRefs($project_id, $version_id, $filter_type, $filter_id, $filter_extension_type)

Returns the resources (items, folders, and versions) which have a custom relationship with the given version_id. Custom relationships can be established between a version of an item and other resources within the 'data' domain service (folders, items, and versions).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Autodesk\Forge\Client\Api\VersionsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$version_id = "version_id_example"; // string | the `version id`
$filter_type = array("filter_type_example"); // string[] | filter by the `type` of the `ref` target
$filter_id = array("filter_id_example"); // string[] | filter by the `id` of the `ref` target
$filter_extension_type = array("filter_extension_type_example"); // string[] | filter by the extension type

try {
    $result = $apiInstance->getVersionRefs($project_id, $version_id, $filter_type, $filter_id, $filter_extension_type);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VersionsApi->getVersionRefs: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
version_id string the `version id`
filter_type string[] filter by the `type` of the `ref` target [optional]
filter_id string[] filter by the `id` of the `ref` target [optional]
filter_extension_type string[] filter by the extension type [optional]

Return type

\Autodesk\Forge\Client\Model\JsonApiCollection

Authorization

oauth2_access_code

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getVersionRelationshipsRefs

\Autodesk\Forge\Client\Model\Refs getVersionRelationshipsRefs($project_id, $version_id, $filter_type, $filter_id, $filter_ref_type, $filter_direction, $filter_extension_type)

Returns the custom relationships that are associated to the given version_id. Custom relationships can be established between a version of an item and other resources within the 'data' domain service (folders, items, and versions).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Autodesk\Forge\Client\Api\VersionsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$version_id = "version_id_example"; // string | the `version id`
$filter_type = array("filter_type_example"); // string[] | filter by the `type` of the `ref` target
$filter_id = array("filter_id_example"); // string[] | filter by the `id` of the `ref` target
$filter_ref_type = array("filter_ref_type_example"); // string[] | filter by `refType`
$filter_direction = "filter_direction_example"; // string | filter by the direction of the reference
$filter_extension_type = array("filter_extension_type_example"); // string[] | filter by the extension type

try {
    $result = $apiInstance->getVersionRelationshipsRefs($project_id, $version_id, $filter_type, $filter_id, $filter_ref_type, $filter_direction, $filter_extension_type);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VersionsApi->getVersionRelationshipsRefs: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
version_id string the `version id`
filter_type string[] filter by the `type` of the `ref` target [optional]
filter_id string[] filter by the `id` of the `ref` target [optional]
filter_ref_type string[] filter by `refType` [optional]
filter_direction string filter by the direction of the reference [optional]
filter_extension_type string[] filter by the extension type [optional]

Return type

\Autodesk\Forge\Client\Model\Refs

Authorization

oauth2_access_code

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postVersion

\Autodesk\Forge\Client\Model\VersionCreated postVersion($project_id, $body)

Creates a new version of an item in the 'data' domain service.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Autodesk\Forge\Client\Api\VersionsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$body = new \Autodesk\Forge\Client\Model\CreateVersion(); // \Autodesk\Forge\Client\Model\CreateVersion | describe the version to be created

try {
    $result = $apiInstance->postVersion($project_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VersionsApi->postVersion: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
body \Autodesk\Forge\Client\Model\CreateVersion describe the version to be created

Return type

\Autodesk\Forge\Client\Model\VersionCreated

Authorization

oauth2_access_code

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postVersionRelationshipsRef

postVersionRelationshipsRef($project_id, $version_id, $body)

Creates a custom relationship between a version and another resource within the 'data' domain service (folder, item, or version).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Autodesk\Forge\Client\Api\VersionsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$version_id = "version_id_example"; // string | the `version id`
$body = new \Autodesk\Forge\Client\Model\CreateRef(); // \Autodesk\Forge\Client\Model\CreateRef | describe the ref to be created

try {
    $apiInstance->postVersionRelationshipsRef($project_id, $version_id, $body);
} catch (Exception $e) {
    echo 'Exception when calling VersionsApi->postVersionRelationshipsRef: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
version_id string the `version id`
body \Autodesk\Forge\Client\Model\CreateRef describe the ref to be created

Return type

void (empty response body)

Authorization

oauth2_access_code

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]