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

Latest commit

 

History

History
421 lines (289 loc) · 15.7 KB

ItemsApi.md

File metadata and controls

421 lines (289 loc) · 15.7 KB

Autodesk\Forge\Client\ItemsApi

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

Method HTTP request Description
getItem GET /data/v1/projects/{project_id}/items/{item_id}
getItemParentFolder GET /data/v1/projects/{project_id}/items/{item_id}/parent
getItemRefs GET /data/v1/projects/{project_id}/items/{item_id}/refs
getItemRelationshipsRefs GET /data/v1/projects/{project_id}/items/{item_id}/relationships/refs
getItemTip GET /data/v1/projects/{project_id}/items/{item_id}/tip
getItemVersions GET /data/v1/projects/{project_id}/items/{item_id}/versions
postItem POST /data/v1/projects/{project_id}/items
postItemRelationshipsRef POST /data/v1/projects/{project_id}/items/{item_id}/relationships/refs

getItem

\Autodesk\Forge\Client\Model\Item getItem($project_id, $item_id)

Returns a resource item by ID for any item within a given project. Resource items represent word documents, fusion design files, drawings, spreadsheets, etc.

Example

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

$apiInstance = new Autodesk\Forge\Client\Api\ItemsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$item_id = "item_id_example"; // string | the `item id`

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

Parameters

Name Type Description Notes
project_id string the `project id`
item_id string the `item 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]

getItemParentFolder

\Autodesk\Forge\Client\Model\Folder getItemParentFolder($project_id, $item_id)

Returns the "parent" folder for the given item.

Example

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

$apiInstance = new Autodesk\Forge\Client\Api\ItemsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$item_id = "item_id_example"; // string | the `item id`

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

Parameters

Name Type Description Notes
project_id string the `project id`
item_id string the `item id`

Return type

\Autodesk\Forge\Client\Model\Folder

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]

getItemRefs

\Autodesk\Forge\Client\Model\JsonApiCollection getItemRefs($project_id, $item_id, $filter_type, $filter_id, $filter_extension_type)

Returns the resources (items, folders, and versions) which have a custom relationship with the given item_id. Custom relationships can be established between 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\ItemsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$item_id = "item_id_example"; // string | the `item 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->getItemRefs($project_id, $item_id, $filter_type, $filter_id, $filter_extension_type);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ItemsApi->getItemRefs: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
item_id string the `item 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]

getItemRelationshipsRefs

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

Returns the custom relationships that are associated to the given item_id. Custom relationships can be established between 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\ItemsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$item_id = "item_id_example"; // string | the `item 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->getItemRelationshipsRefs($project_id, $item_id, $filter_type, $filter_id, $filter_ref_type, $filter_direction, $filter_extension_type);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ItemsApi->getItemRelationshipsRefs: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
item_id string the `item 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]

getItemTip

\Autodesk\Forge\Client\Model\Version getItemTip($project_id, $item_id)

Returns the "tip" version for the given item. Multiple versions of a resource item can be uploaded in a project. The tip version is the most recent one.

Example

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

$apiInstance = new Autodesk\Forge\Client\Api\ItemsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$item_id = "item_id_example"; // string | the `item id`

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

Parameters

Name Type Description Notes
project_id string the `project id`
item_id string the `item 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]

getItemVersions

\Autodesk\Forge\Client\Model\Versions getItemVersions($project_id, $item_id, $filter_type, $filter_id, $filter_extension_type, $filter_version_number, $page_number, $page_limit)

Returns versions for the given item. Multiple versions of a resource item can be uploaded in a project.

Example

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

$apiInstance = new Autodesk\Forge\Client\Api\ItemsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$item_id = "item_id_example"; // string | the `item 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
$filter_version_number = array(56); // int[] | filter by `versionNumber`
$page_number = 56; // int | specify the page number
$page_limit = 56; // int | specify the maximal number of elements per page

try {
    $result = $apiInstance->getItemVersions($project_id, $item_id, $filter_type, $filter_id, $filter_extension_type, $filter_version_number, $page_number, $page_limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ItemsApi->getItemVersions: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string the `project id`
item_id string the `item 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]
filter_version_number int[] filter by `versionNumber` [optional]
page_number int specify the page number [optional]
page_limit int specify the maximal number of elements per page [optional]

Return type

\Autodesk\Forge\Client\Model\Versions

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]

postItem

\Autodesk\Forge\Client\Model\ItemCreated postItem($project_id, $body)

Creates a new item in the 'data' domain service.

Example

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

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

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

Parameters

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

Return type

\Autodesk\Forge\Client\Model\ItemCreated

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]

postItemRelationshipsRef

postItemRelationshipsRef($project_id, $item_id, $body)

Creates a custom relationship between an item 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\ItemsApi($authObject);
$project_id = "project_id_example"; // string | the `project id`
$item_id = "item_id_example"; // string | the `item id`
$body = new \Autodesk\Forge\Client\Model\CreateRef(); // \Autodesk\Forge\Client\Model\CreateRef | describe the ref to be created

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

Parameters

Name Type Description Notes
project_id string the `project id`
item_id string the `item 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]