This repository contains various examples of how to use the Autodesk Tandem Data REST API to achieve certain workflows. These are reference implementations that can be adopted for specific scenarios.
The examples are written in JavaScript and require Node.js.
Use npm to install required dependencies
npm iThe examples use 2-legged authentication in cases where authentication is needed. This requires that an application be added to a facility as a service:
- Create new application using the APS Portal.
- Open the facility in Autodesk Tandem.
- Navigate to the "Users" tab on the left panel, then select "Service" and enter the Client ID of the application from step 1 above. Make sure to specify the correct permissions.
- After this, the application should be able to use a 2-legged token when interacting with the facility.
NOTE: As an alternative,the application can be added to your Tandem account. In this case the application will have access to all facilities owned by the account.
Most of the examples are self-contained. To run a specific example, use the following steps:
- Open the folder using your code editor.
- Locate the example you want to run and open it.
- At the top of the source file there is a block of source code with global variables. Replace those variables according to your environment:
// update values below according to your environment
const APS_CLIENT_ID = 'YOUR_CLIENT_ID';
const APS_CLIENT_SECRET = 'YOUR_CLIENT_SECRET';
const FACILITY_URN = 'YOUR_FACILITY_URN';- Check
mainfunction and place breakpoints as needed. - Start debugger. During debugging use the debuger windows to inspect values of variables.
The examples can be executed using Node.js runtime. When using in the browser environment it's necessary to use polyfill for Node.js Buffer - i.e. this one.
The examples are organized into multiple folders based on topic:
- assets - asset related examples
- classification - classification related examples
- documents - document related examples
- elements - generic examples related to elements
- facility - facility related examples
- groups - group related examples
- history - history related examples
- streams - streams related examples
- systems - system related examples
- tickets - ticket related examples
- views - view related examples