### setUp(config) Source: https://aps.autodesk.com/en/docs/viewer/v6/reference/Viewing/GuiViewer3D Initializes the viewer by loading extensions and setting up canvas interactions. This method is automatically invoked by the `start` method. ```APIDOC ## setUp(config) ### Description Loading extensions and initializing canvas interactions. Invoked automatically by Autodesk.Viewing.Viewer3D#start method. ### Parameters * **config** (ViewerConfig) - Required - Configuration values for the viewer. ``` -------------------------------- ### BIM 360 API - Getting Started Source: https://aps.autodesk.com/en/docs/bim360/v1/tutorials/en/docs/bim360/v1/en/docs/bim360/v1/tutorials Guides on how to get started with the BIM 360 API, including obtaining access to accounts and managing API access. ```APIDOC ## Getting Started ### Description Guides on how to get started with the BIM 360 API, including obtaining access to accounts and managing API access. ### How-to Guide - Get Access to a BIM 360 Account - Manage API Access to BIM 360 Docs - Retrieve BIM 360 Account and Project ID ``` -------------------------------- ### Initialize and Upload with OssClient Source: https://aps.autodesk.com/en/docs/data/v2/reference/dot-net-sdk-oss Demonstrates how to initialize the SDK manager and OssClient, and then upload a file to a bucket using the OssClient's Upload method. Ensure you have a valid access token, bucket key, object name, and the path to the source file. ```csharp string token = ""; string bucketKey = ""; string objectName = ""; string sourceToUpload = ""; OssClient ossClient = null!; public void Initialise() { // Instantiate SDK manager as below. // You can also optionally pass configurations, logger, etc. SDKManager sdkManager = SdkManagerBuilder .Create() // Creates SDK Manager Builder itself. .Build(); // Instantiate OssClient using the created SDK manager ossClient = new OssClient(sdkManager); } public async Task Upload() { //The below helper method takes care of the complete upload process, i.e. // the steps 2 to 4 in this link (https://aps.autodesk.com/en/docs/data/v2/tutorials/app-managed-bucket/) ObjectDetails objectDetails = await ossClient.Upload(bucketKey, objectName, sourceToUpload, accessToken: token, CancellationToken.None); // query for required properties string objectId = objectDetails.ObjectId; string objectKey = objectDetails.ObjectKey; } ``` -------------------------------- ### Get Metadata by URN and GUID Source: https://aps.autodesk.com/en/docs/model-derivative/v2/reference/http/metadata/urn-metadata-guid-GET This example demonstrates how to retrieve the object hierarchy of a derivative file using its URN and a specific GUID. ```APIDOC ## GET /modelderivative/v2/designdata/:urn/metadata/:guid ### Description Retrieves the metadata for a specific URN and GUID, providing details about the derivative file's structure. ### Method GET ### Endpoint /modelderivative/v2/designdata/:urn/metadata/:guid ### Parameters #### Path Parameters - **urn** (string) - Required - The URN of the derivative file. - **guid** (string) - Required - The GUID of the metadata to retrieve. ### Request Example #### cURL ```bash curl --location 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/6bfb4886-f2ee-9ccb-8db0-c5c170220c40' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' ``` #### JavaScript (Fetch) ```javascript const myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer "); myHeaders.append("Content-Type", "application/json"); const requestOptions = { method: "GET", headers: myHeaders, redirect: "follow" }; fetch("https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/6bfb4886-f2ee-9ccb-8db0-c5c170220c40", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error)); ``` #### C# (HttpClient) ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/6bfb4886-f2ee-9ccb-8db0-c5c170220c40"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` #### Python (Requests) ```python import requests url = "https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/6bfb4886-f2ee-9ccb-8db0-c5c170220c40" headers = { 'Authorization': 'Bearer ', 'Content-Type': 'application/json' } response = requests.request("GET", url, headers=headers) print(response.text) ``` ### Response #### Success Response (200) - **data** (object) - Envelope that contains the returned data. - **type** (string) - The type of data that is returned. Always `objects`. - **objects** (array) - Collection of objects that constitute the nodes of the object tree. - **objectid** (number) - A non-persistent ID assigned to an object at translation time. - **objects** (array) - An optional array of objects representing child nodes. #### Response Example ```json { "data": { "type": "objects", "objects": [ { "objectid": 1, "objects": [ { "objectid": 91, "objects": [ { "objectid": 4268, "objects": [ // ... more nested objects ] } ] } ] } ] } } ``` ``` -------------------------------- ### Get Object Hierarchy by GUID Source: https://aps.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-GET This example demonstrates the successful retrieval of the object hierarchy of a Revit model using its URN and a metadata GUID. ```APIDOC ## GET /modelderivative/v2/designdata/:urn/metadata/:guid ### Description Retrieves the metadata for a specific object within a translated design, identified by its URN and a GUID. ### Method GET ### Endpoint /modelderivative/v2/designdata/:urn/metadata/:guid ### Parameters #### Path Parameters - **urn** (string) - Required - The URN of the translated design. - **guid** (string) - Required - The GUID of the metadata to retrieve. ### Request Example ```curl curl --location 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/6bfb4886-f2ee-9ccb-8db0-c5c170220c40' \ --header 'Authorization: Bearer eyJh...' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - Envelope that contains the returned data. - **type** (string) - The type of data that is returned. Always `objects`. - **objects** (array) - Collection of “objects” that constitute the nodes of the object tree. - **objectid** (number) - A non-persistent ID that is assigned to an object at translation time. - **objects** (array) - An optional array of objects of type `object` where each object represents a child of the current node on the object tree. #### Response Example ```json { "data": { "type": "objects", "objects": [ { "objectid": 1, "objects": [ { "objectid": 91, "objects": [ { "objectid": 4268, "objects": [ { "objectid": 4269 } ] } ] } ] } ] } } ``` ``` -------------------------------- ### start(url, options, onSuccessCallback, onErrorCallback, initOptions) Source: https://aps.autodesk.com/en/docs/viewer/v7/reference/Viewing/Viewer3D Initializes the viewer and optionally loads extensions and a model. This method optimizes the initialization sequence for faster model loading when parameters are provided. ```APIDOC ## start(url, options, onSuccessCallback, onErrorCallback, initOptions) ### Description Initializes the viewer and loads any extensions specified in the constructor's config parameter. If optional parameters are specified, the start() function will use an optimized initialization sequence that results in faster model load. The parameters are the same as the ones for Viewer3D.loadModel and you do not need to call loadModel subsequently if the model is loaded via the call to start(). ### Parameters * **url** (string) - Optional. URN or filepath to load on start. * **options** (object) - Optional. Path to shared property database. * **onSuccessCallback** (Autodesk.Viewing.Viewer3D~onLoadModelSuccess) - Optional. Method that gets called when initial loading is done and streaming starts. * **onErrorCallback** (Autodesk.Viewing.Viewer3D~onLoadModelFailure) - Optional. Method that gets called when initial loading ends with an error. * **initOptions** (object) - Optional. Options forwarded to viewer.initialize(). ### Returns * **number** - 0 if the viewer has started, an error code (same as that returned by initialize()) otherwise. ``` -------------------------------- ### Get URN Metadata GUID Source: https://aps.autodesk.com/en/docs/model-derivative/v2/reference/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-GET This example demonstrates how to retrieve the object hierarchy of a translated model using its URN and a specific metadata GUID. ```APIDOC ## GET /modelderivative/v2/designdata/{urn}/metadata/{guid} ### Description Retrieves the metadata for a specific URN, identified by a GUID. ### Method GET ### Endpoint /modelderivative/v2/designdata/{urn}/metadata/{guid} ### Parameters #### Path Parameters - **urn** (string) - Required - The URN of the object. - **guid** (string) - Required - The GUID of the metadata to retrieve. ### Request Example ```bash curl --location 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/6bfb4886-f2ee-9ccb-8db0-c5c170220c40' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - Envelope that contains the returned data. - **type** (string) - The type of data that is returned. Always `objects`. - **objects** (array) - Collection of “objects” that constitute the nodes of the object tree. - **objectid** (number) - A non-persistent ID that is assigned to an object at translation time. - **name** (string) - Name of the object. - **objects** (array) - An optional array of objects of type `object` where each object represents a child of the current node on the object tree. #### Response Example ```json { "data": { "type": "objects", "objects": [ { "objectid": 1, "objects": [ { "objectid": 91, "objects": [ { "objectid": 4268, "objects": [ { "objectid": 4269, "name": "Level 1" } ], "name": "Revit Project" } ], "name": "Project" } ], "name": "Project" } ] } } ``` ``` -------------------------------- ### setUp(config) Source: https://aps.autodesk.com/en/docs/viewer/v7/reference/Viewing/GuiViewer3D Initializes the viewer by loading extensions and setting up canvas interactions. This method is automatically invoked by the `start` method of `Autodesk.Viewing.Viewer3D`. ```APIDOC ## setUp(config) ### Description Loading extensions and initializing canvas interactions. Invoked automatically by Autodesk.Viewing.Viewer3D#start method. ### Parameters * __config object| configuration values * __extensions Array.| List of extension ids to load with the model. * __canvasConfig object| Overrides for click/tap events on the 3D canvas. Refer to #setCanvasClickBehavior for details. ``` -------------------------------- ### Get URN Metadata GUID Properties Source: https://aps.autodesk.com/en/docs/model-derivative/v2/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-properties-GET This example demonstrates how to retrieve all properties for a given URN and GUID. It shows requests in cURL, JavaScript, C#, and Python. ```APIDOC ## GET /modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/4f981e94-8241-4eaf-b08b-cd337c6b8b1f/properties ### Description Retrieves all properties of all objects associated with a specific URN and GUID. ### Method GET ### Endpoint /modelderivative/v2/designdata/{urn}/metadata/{guid}/properties ### Parameters #### Path Parameters - **urn** (string) - Required - The URN of the design data. - **guid** (string) - Required - The GUID of the metadata. #### Query Parameters None #### Request Body None ### Request Example #### cURL ``` curl --location 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/4f981e94-8241-4eaf-b08b-cd337c6b8b1f/properties' \ --header 'Authorization: Bearer eyJh......' ``` #### JavaScript (Fetch) ```javascript // Create a new Headers object and set the required headers const myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer eyJh......"); // Replace with your access token // Set up the request options for the fetch call const requestOptions = { method: "GET", headers: myHeaders, redirect: "follow" }; // Make the GET request to the Model Derivative API for properties fetch("https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/4f981e94-8241-4eaf-b08b-cd337c6b8b1f/properties", requestOptions) .then((response) => response.text()) // Parse the response as text .then((result) => console.log(result)) // Log the result to the console .catch((error) => console.error(error)); // Log any errors ``` #### C# (HttpClient) ```csharp // Create a new HttpClient instance var client = new HttpClient(); // Create a new HttpRequestMessage for the GET request var request = new HttpRequestMessage( HttpMethod.Get, "https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/4f981e94-8241-4eaf-b08b-cd337c6b8b1f/properties" ); // Add the Authorization header with your access token request.Headers.Add("Authorization", "Bearer eyJh......"); // Send the request asynchronously and get the response var response = await client.SendAsync(request); // Throw an exception if the response indicates an error response.EnsureSuccessStatusCode(); // Read and print the response content as a string Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` #### Python (Requests) ```python import requests # Set the API endpoint URL for the properties request url = "https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/4f981e94-8241-4eaf-b08b-cd337c6b8b1f/properties" # Set the required headers, including your access token headers = { 'Authorization': 'Bearer eyJh......', # Replace with your access token } # Make the GET request to the Model Derivative API response = requests.request("GET", url, headers=headers) # Print the response text (the properties) print(response.text) ``` ### Response #### Success Response (200) - **resultstring** (string) - A JSON object containing the properties of the objects. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Viewer Setup and Model Loading Source: https://aps.autodesk.com/en/docs/viewer/v6/tutorials/basic-viewer Initializes the viewer with extensions, then loads a model with specified options. Handles success and error callbacks. ```javascript viewer.tearDown(); var config = { extensions: nextGeom.extensions() || [] }; viewer.setUp(config); var svfUrl = lmvDoc.getViewablePath(nextGeom); var loaderOptions = { sharedPropertyDbPath: lmvDoc.getPropertyDbPath() }; viewer.loadModel(svfUrl, loaderOptions, onLoadModelSuccess, onLoadModelError); ``` -------------------------------- ### Run Sample Command Source: https://aps.autodesk.com/en/docs/aecdatamodel/v1/code-samples/compareversions Execute this command in the terminal to run the sample application. ```bash dotnet run ``` -------------------------------- ### Get URN Metadata GUID Properties Source: https://aps.autodesk.com/en/docs/model-derivative/v2/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-properties-GET This example demonstrates how to retrieve properties for a given URN and metadata GUID. It shows a scenario that might result in a 404 Not Found status if the data cannot be queried. ```APIDOC ## GET /modelderivative/v2/designdata/{urn}/metadata/{guid}/properties ### Description Retrieves the properties associated with a specific metadata GUID within a given URN. ### Method GET ### Endpoint /modelderivative/v2/designdata/{urn}/metadata/{guid}/properties ### Parameters #### Path Parameters - **urn** (string) - Required - The URN of the design data. - **guid** (string) - Required - The metadata GUID for which to retrieve properties. ### Request Example ```bash curl \ --location 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/c213b30e-73be-4060-ad9d-06f043192d9f/properties' \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **diagnostic** (string) - A message indicating the status of the query. #### Response Example (404 Not Found) ```json { "diagnostic": "Failed to query the data." } ``` ``` -------------------------------- ### start Source: https://aps.autodesk.com/en/docs/viewer/v6/reference/Viewing/Viewer3D Initializes the viewer and loads any extensions specified in the constructor’s config parameter. If optional parameters are specified, it uses an optimized initialization sequence for faster model loading. ```APIDOC ## start(url, options, onSuccessCallback, onErrorCallback) ### Description Initializes the viewer and loads any extensions specified in the constructor’s config parameter. If the optional parameters are specified, the start() function will use an optimized initialization sequence that results in faster model load. The parameters are the same as the ones for Viewer3D.loadModel and you do not need to call loadModel subsequently if the model is loaded via the call to start(). ### Parameters - **url** (string) - Optional - URN or filepath to load on start. - **options** (string) - Optional - Path to shared property database. - **onSuccessCallback** (Autodesk.Viewing.Viewer3D~onLoadModelSuccess) - Method that gets called when initial loading is done and streaming starts. - **onErrorCallback** (Autodesk.Viewing.Viewer3D~onLoadModelFailure) - Method that gets called when initial loading ends with an error. ### Returns - **number** - 0 if the viewer has started, an error code (same as that returned by initialize()) otherwise. ``` -------------------------------- ### Get Object Hierarchy Source: https://aps.autodesk.com/en/docs/model-derivative/v2/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-GET This example demonstrates the successful retrieval of the object hierarchy of a Revit model using its URN and a specific metadata GUID. ```APIDOC ## GET /modelderivative/v2/designdata/:urn/metadata/:guid ### Description Retrieves the metadata hierarchy for a specific object within a translated design, identified by its GUID. ### Method GET ### Endpoint /modelderivative/v2/designdata/:urn/metadata/:guid ### Parameters #### Path Parameters - **urn** (string) - Required - The URN of the translated design. - **guid** (string) - Required - The GUID of the specific object whose metadata is to be retrieved. #### Request Body This endpoint does not accept a request body. ### Response #### Success Response (200) - **data** (object) - Envelope that contains the returned data. - **type** (string) - The type of data that is returned. Always `objects`. - **objects** (array) - Collection of “objects” that constitute the nodes of the object tree. - **objectid** (number) - A non-persistent ID that is assigned to an object at translation time. - **name** (string) - Name of the object. - **objects** (array) - An optional array of objects of type `object` where each object represents a child of the current node on the object tree. ### Request Example ```curl curl --location 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/6bfb4886-f2ee-9ccb-8db0-c5c170220c40' \ --header 'Authorization: Bearer eyJh...' \ --header 'Content-Type: application/json' ``` ### Response Example ```json { "data": { "type": "objects", "objects": [ { "objectid": 1, "objects": [ { "objectid": 91, "objects": [ { "objectid": 4268, "objects": [ { ... } ] } ] } ] } ] } } ``` ``` -------------------------------- ### Get Properties by URN and GUID Source: https://aps.autodesk.com/en/docs/model-derivative/v2/reference/http/metadata/urn-metadata-guid-properties-GET This example demonstrates how to retrieve the properties of a model derivative item using its URN and GUID. The response includes a collection of objects, each with an object ID, name, external ID, and a detailed properties object. ```APIDOC ## GET /modelderivative/v2/designdata/{urn}/metadata/{guid}/properties ### Description Retrieves the properties of a specific model derivative item identified by its URN and GUID. ### Method GET ### Endpoint /modelderivative/v2/designdata/{urn}/metadata/{guid}/properties ### Parameters #### Path Parameters - **urn** (string) - Required - The URN of the model derivative. - **guid** (string) - Required - The GUID of the metadata to retrieve properties for. ### Response #### Success Response (200 OK) - **data.type** (string) - The type of the data, which is 'properties'. - **data.collection** (array) - An array of objects, where each object represents a property set. - **objectid** (integer) - The unique identifier for the object. - **name** (string) - The name of the object. - **externalId** (string) - The external identifier for the object. - **properties** (object) - An object containing the detailed properties of the item. ### Response Example ```json { "data": { "type": "properties", "collection": [ { "objectid": 1, "name": "A5", "externalId": "mou0zG8ViUOsqUzhb4TUiA", "properties": { "Name": "A5" } }, { "objectid": 2, "name": "Model", "externalId": "z4u0zG8ViUOsqUzhb4TUiA", "properties": { "Component Name": "Model", "Name": "Model", "Design Tracking Properties": { "Design State": "WorkInProgress", "Designer": "ADSK", "File Subtype": "Assembly" }, "File Properties": { "Author": "ADSK", "Creation Date": "2012-Jul-09 20:18:20", "Original System": "Autodesk Inventor 2017", "Part Number": "Model" }, "Mass Properties": { "Area": "19772.676 millimeter^2", "Volume": "83673.946 millimeter^3" } } } ] } } ``` ``` -------------------------------- ### start(url, options, onSuccessCallback, onErrorCallback) Source: https://aps.autodesk.com/en/docs/viewer/v2/reference/javascript/viewer3d Initializes the viewer and loads extensions. Can optionally load a model and use an optimized initialization sequence for faster loading. ```APIDOC ## start(url, options, onSuccessCallback, onErrorCallback) ### Description Initializes the viewer and loads any extensions specified in the constructor’s config parameter. If the optional parameters are specified, the start() function will use an optimized initialization sequence that results in faster model load. The parameters are the same as the ones for Viewer3D.loadModel and you do not need to call loadModel subsequently if the model is loaded via the call to start(). ### Parameters - **url** (string) - Optional URN or filepath to load on start. - **options** (string) - Optional path to shared property database. - **onSuccessCallback** (function) - Method that gets called when initial loading is done and streaming starts. - **onErrorCallback** (function) - Method that gets called when initial loading ends with an error. ### Returns - **number** - 0 if the viewer has started, an error code (same as that returned by initialize()) otherwise. ``` -------------------------------- ### GET URN Properties Source: https://aps.autodesk.com/en/docs/model-derivative/v2/reference/dot-net-sdk/Autodesk.ModelDerivative/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-properties-GET Retrieves properties for a specific URN and metadata GUID. This example demonstrates a failed attempt or a timeout, resulting in a 404 status code. ```APIDOC ## GET URN Properties ### Description Retrieves properties for a specific URN and metadata GUID. This operation is useful for accessing detailed information about model elements. ### Method GET ### Endpoint `https://developer.api.autodesk.com/modelderivative/v2/designdata//metadata//properties` ### Parameters #### Path Parameters - **urn** (string) - Required - The URN of the design. - **guid** (string) - Required - The metadata GUID of the properties to retrieve. #### Request Body This endpoint does not accept a request body. ### Request Example #### cURL ```bash curl \ --location 'https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWxkZXJpdmF0aXZlL0E1LnppcA/metadata/c213b30e-73be-4060-ad9d-06f043192d9f/properties' \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200 OK) - **field1** (type) - Description #### Error Response (404 Not Found) - **diagnostic** (string) - A message indicating the failure, e.g., "Failed to query the data." #### Response Example (404 Not Found) ```json { "diagnostic": "Failed to query the data." } ``` ``` -------------------------------- ### Initialize Node.js Project with Express Source: https://aps.autodesk.com/en/docs/webhooks/v1/tutorials/how-to-verify-payload-signature Set up a basic Express.js server for handling incoming webhook requests. Ensure Node.js is installed. ```javascript var express = require('express'); app.listen(3000, function () { console.log('Listening on port 3000!'); }); ``` -------------------------------- ### Get URN Metadata GUID Properties Source: https://aps.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-properties-GET This example demonstrates how to retrieve properties for a given URN and metadata GUID. The `x-ads-force` header can be used to retry on recoverable failures, ensuring a 200 OK response even if temporary issues occur. ```APIDOC ## GET /modelderivative/v2/designdata/:urn/metadata/:guid/properties ### Description Retrieves the properties associated with a specific metadata GUID for a given URN. The `x-ads-force` header can be set to `true` to retry on recoverable failures, aiming for a 200 OK response. ### Method GET ### Endpoint `https://developer.api.autodesk.com/modelderivative/v2/designdata//metadata//properties` ### Headers - **Authorization** (string) - Required - Bearer token for authentication. - **x-ads-force** (boolean) - Optional - If set to `true`, the service will retry on recoverable failures. ### Response #### Success Response (200) Returns a JSON object containing the properties of the specified metadata. ```json { "properties": [ { "name": "string", "value": "string", "displayValue": "string" } ] } ``` ``` -------------------------------- ### Create a project from a template Source: https://aps.autodesk.com/en/docs/buildingconnected/v2/reference/http/buildingconnected-projects-POST This example demonstrates how to create a new project by sending a POST request to the projects endpoint. It includes various fields to define the project's name, client, value, location, and template settings. ```APIDOC ## POST /v2/projects ### Description Creates a new project. ### Method POST ### Endpoint /v2/projects ### Request Body - **name** (string) - Required - The name of the project. - **number** (string) - Optional - The project number. - **client** (string) - Optional - The client associated with the project. - **value** (number) - Optional - The estimated value of the project. - **notes** (string) - Optional - Notes about the project. - **projectSize** (number) - Optional - The size of the project. - **projectSizeUnits** (string) - Optional - The units for project size (e.g., SQUARE_FEET). - **isBiddingSealed** (boolean) - Optional - Indicates if bidding is sealed. - **owningOfficeId** (string) - Required - The ID of the owning office. - **isPublic** (boolean) - Optional - Indicates if the project is public. - **bidsDueAt** (string) - Optional - The date and time when bids are due. - **endsAt** (string) - Optional - The date and time when the project ends. - **rfisDueAt** (string) - Optional - The date and time when RFIs are due. - **startsAt** (string) - Optional - The date and time when the project starts. - **jobWalkAt** (string) - Optional - The date and time for the job walk. - **dueAt** (string) - Optional - The due date for the project. - **location** (object) - Optional - The location details of the project. - **country** (string) - Optional - **state** (string) - Optional - **streetName** (string) - Optional - **streetNumber** (string) - Optional - **suite** (string) - Optional - **city** (string) - Optional - **zip** (string) - Optional - **accountManager** (string) - Optional - The account manager for the project. - **feePercentage** (number) - Optional - The fee percentage for the project. - **marketSector** (string) - Optional - The market sector of the project. - **defaultCurrency** (string) - Optional - The default currency for the project. - **architect** (string) - Optional - The architect for the project. - **isForBudgeting** (boolean) - Optional - Indicates if the project is for budgeting. - **isCompetitive** (boolean) - Optional - Indicates if the project is competitive. - **relevantCertificates** (array) - Optional - A list of relevant certificates. - **agency** (object) - Required - **id** (string) - Required - **certificateType** (object) - Required - **id** (string) - Required - **originalProjectId** (string) - Optional - The ID of the original project if this is a copy. - **template** (object) - Optional - Template settings for project creation. - **includeInfo** (boolean) - Optional - **includeCosts** (boolean) - Optional - **includeForm** (boolean) - Optional - **includeFiles** (boolean) - Optional - **bidPackages** (object) - Optional - **includeForm** (boolean) - Optional - **includeFiles** (boolean) - Optional - **bidderStates** (array) - Optional - (string) ### Request Example ```json { "name": "Office Renovation", "number": "12345", "client": "Wells Fargo", "value": 1000000, "notes": "
This project's important notes.
", "projectSize": 32000, "projectSizeUnits": "SQUARE_FEET", "isBiddingSealed": false, "owningOfficeId": "5fcdcd0b3db0876c6692d5bb", "isPublic": true, "bidsDueAt": "2014-09-22T16:27:37.437Z", "endsAt": "2014-09-22T16:27:37.437Z", "rfisDueAt": "2014-09-22T16:27:37.437Z", "startsAt": "2014-09-22T16:27:37.437Z", "jobWalkAt": "2014-09-22T16:27:37.437Z", "dueAt": "2014-09-22T16:27:37.437Z", "location": { "country": "US", "state": "CA", "streetName": "California St.", "streetNumber": "600", "suite": "6th Floor", "city": "San Francisco", "zip": "94108" }, "accountManager": "Name of account manager", "feePercentage": 15.55, "marketSector": "Sports Stadium Construction", "defaultCurrency": "USD", "architect": "Browning Day Mullins Dierdorf Architects", "isForBudgeting": false, "isCompetitive": false, "relevantCertificates": [ { "agency": { "id": "51bea397f5846f95994bf3a9" }, "certificateType": { "id": "51bea397f5846f95994bf3aa" } } ], "originalProjectId": "5fcdcd0b3db0876c6692d17e", "template": { "includeInfo": false, "includeCosts": false, "includeForm": true, "includeFiles": false, "bidPackages": { "includeForm": true, "includeFiles": false, "bidderStates": [ "NOT_BIDDING", "BIDDING", "BID_SUBMITTED" ] } } } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created project. - **name** (string) - The name of the project. - **number** (string) - The project number. - **client** (string) - The client associated with the project. - **description** (string) - A short description of the project. - **notes** (string) - Notes about the project. - **value** (number) - The estimated value of the project. - **projectSize** (number) - The size of the project. - **projectSizeUnits** (string) - The units for project size. - **awarded** (string) - The award status of the project. - **isBiddingSealed** (boolean) - Indicates if bidding is sealed. - **state** (string) - The current state of the project. - **isNdaRequired** (boolean) - Indicates if an NDA is required. - **isProjectNameShownBeforeSigningNda** (boolean) - Indicates if the project name is shown before signing an NDA. - **isPublic** (boolean) - Indicates if the project is public. - **createdAt** (string) - The date and time the project was created. - **updatedAt** (string) - The date and time the project was last updated. - **publishedAt** (string) - The date and time the project was published. - **bidsDueAt** (string) - The date and time when bids are due. - **endsAt** (string) - The date and time when the project ends. - **rfisDueAt** (string) - The date and time when RFIs are due. - **startsAt** (string) - The date and time when the project starts. - **jobWalkAt** (string) - The date and time for the job walk. - **dueAt** (string) - The due date for the project. - **location** (object) - The location details of the project. - **country** (string) - **state** (string) - **streetName** (string) - **streetNumber** (string) - **suite** (string) - **city** (string) - **zip** (string) - **complete** (string) - **coords** (object) - **lat** (number) - **lng** (number) - **precisionLevel** (number) - **isTemplate** (boolean) - Indicates if the project is a template. - **accountManager** (string) - The account manager for the project. - **feePercentage** (number) - The fee percentage for the project. - **marketSector** (string) - The market sector of the project. - **createdBy** (string) - The ID of the user who created the project. - **defaultCurrency** (string) - The default currency for the project. - **owningOfficeId** (string) - The ID of the owning office. - **architect** (string) - The architect for the project. - **isForBudgeting** (boolean) - Indicates if the project is for budgeting. - **isCompetitive** (boolean) - Indicates if the project is competitive. - **currentAccLinkedProjectId** (string) - The ID of the linked project in ACC. - **currentAccLinkedHubId** (string) - The ID of the linked hub in ACC. - **originalProjectId** (string) - The ID of the original project if this is a copy. - **currentAccDocsFolderId** (string) - The ID of the documents folder in ACC. - **accProjectLinkedAt** (string) - The date and time the project was linked in ACC. - **relevantCertificates** (array) - A list of relevant certificates. - **agency** (object) - **id** (string) - **name** (string) - **website** (string) - **certificateType** (object) - **id** (string) - **name** (string) - **opportunityProjectPair** (object) - **id** (string) - **opportunityId** (string) ### Response Example ```json { "id": "59d2bd7440b36a0da258f24d", "name": "Office Renovation", "number": "12345", "client": "Wells Fargo", "description": "Short description of the project", "notes": "Any notes about the project", "value": 1000000, "projectSize": 2000, "projectSizeUnits": "SQUARE_FEET", "awarded": "WON", "isBiddingSealed": false, "state": "PUBLISHED", "isNdaRequired": false, "isProjectNameShownBeforeSigningNda": false, "isPublic": false, "createdAt": "2014-09-22T16:27:37.437Z", "updatedAt": "2014-09-23T16:28:37.437Z", "publishedAt": "2014-09-22T21:34:44.511Z", "bidsDueAt": "2014-10-03T19:00:00.000Z", "endsAt": "2015-03-31T07:00:00.000Z", "rfisDueAt": "2014-09-25T19:00:00.000Z", "startsAt": "2014-11-03T08:00:00.000Z", "jobWalkAt": "2015-03-31T07:00:00.000Z", "dueAt": "2014-09-03T08:00:00.000Z", "location": { "country": "US", "state": "CA", "streetName": "California St.", "streetNumber": "600", "suite": "6th Floor", "city": "San Francisco", "zip": "94108", "complete": "600 California St., 6th Floor, San Francisco, CA 94108", "coords": { "lat": -122.4069826, "lng": 37.7929546 }, "precisionLevel": 10 }, "isTemplate": false, "accountManager": "Name of account manager", "feePercentage": 15.55, "marketSector": "Sports Stadium Construction", "createdBy": "5a1dc3cf5b54e06ca307d7af", "defaultCurrency": "USD", "owningOfficeId": "5fcdcd0b3db0876c6692d5bb", "architect": "Browning Day Mullins Dierdorf Architects", "isForBudgeting": false, "isCompetitive": true, "currentAccLinkedProjectId": null, "currentAccLinkedHubId": null, "originalProjectId": "5fcdcd0b3db0876c6692d17e", "currentAccDocsFolderId": null, "accProjectLinkedAt": "2014-10-03T19:00:00.000Z", "relevantCertificates": [ { "agency": { "id": "611d794f7f063800a7274d46", "name": "United States Department of Transportation", "website": "https://www.transportation.gov/civil-rights/disadvantaged-business-enterprise" }, "certificateType": { "id": "59d2bd7440b36a0da258f24d", "name": "Disadvantaged Business Enterprise (DBE)" } } ], "opportunityProjectPair": { "id": null, "opportunityId": null } } ``` ```