Skip to content

coolOrangeSamples/powerAPS-Modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

powerAPS-Modules

Windows PowerShell coolOrange powerJobs coolOrange powerEvents Autodesk Platform Services

Disclaimer

THE SAMPLE CODE ON THIS REPOSITORY IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.

THE USAGE OF THIS SAMPLE IS AT YOUR OWN RISK AND THERE IS NO SUPPORT RELATED TO IT.


Description

This repository contains the core PowerShell modules that enable communication between COOLORANGE powerJobs/powerEvents and Autodesk Platform Services (APS) endpoints. These modules provide the foundational API connectivity for integrating Autodesk Vault with cloud services including Autodesk Construction Cloud (ACC), BIM 360, and Fusion.

The powerAPS modules serve as the communication layer that abstracts APS API complexity and provides PowerShell-friendly cmdlets for authentication, data management, and cloud service interactions.


Prerequisites

Note: powerJobs Processor version 26.0.4 or greater and powerEvents version 26.0.7 or greater are required.

These modules are designed to work with:

  • powerJobs Processor (Vault Job Processor side automation)
  • powerEvents (powerJobs Client) (Vault Client side extensions)
  • Autodesk Vault Professional 2023 or later

Related Repositories

The powerAPS-Modules serve as the foundation that all powerAPS-* repos depend on for APS connectivity.


Installation

Important: Files downloaded from GitHub may be blocked by Windows. You must unblock all files before installation:

  1. Right-click each downloaded file → Properties
  2. Check "Unblock" at the bottom → Apply → OK
  3. Or use PowerShell: Get-ChildItem -Recurse | Unblock-File
  1. Download or clone this repository
  2. Unblock all downloaded files (see important note above)
  3. Copy all files from the powerAPS directory to:
    C:\ProgramData\coolOrange\powerAPS\
  4. Restart any running powerJobs Processor, Vault Job Processor or Vault Explorer instances

Integration with coolOrange powerAPS Module

The modules in this repository work in conjunction with coolOrange's powerAPS module, which provides the core authentication and connection infrastructure for Autodesk Platform Services integration. This official module is included with powerJobs Processor v26.0.4+ and powerEvents v26.0.7+.


Core powerAPS Module Overview

The main powerAPS module provides essential cmdlets and objects that serve as the foundation for all APS communication:

Connect-APS Cmdlet

The primary authentication cmdlet that establishes OAuth 2.0 connections to Autodesk Platform Services:

# Basic authentication using signed-in Autodesk ID
Connect-APS

# Custom app authentication  
Connect-APS -ClientId "your-client-id" -ClientSecret "your-secret" -CallbackUrl "http://localhost:8080/"

# Job processor impersonation
Connect-APS -User $job.SubmittedByAutodeskId

APSConnection Global Object

After successful authentication, the $global:APSConnection object provides:

  • Authorization headers for API calls
  • Hub information and access
  • User context and impersonation details
  • Token management and automatic refresh

Authentication Workflows

Authentication on the Vault Client

For powerEvents and Vault Explorer extensions:

# Import additional modules from this repository
foreach ($module in Get-ChildItem "C:\ProgramData\coolOrange\powerAPS" -Name -Filter "*.psm1") {
    Import-Module "C:\ProgramData\coolOrange\powerAPS\$module" -Force
}

# Establish connection (may open browser for consent)
$connected = Connect-APS -ClientId "your-app-client-id" -ClientSecret "your-app-secret" -CallbackUrl "http://localhost:8080/callback"if ($connected) {
    # Use modules from this repository for specific operations
    $hub = Get-ApsAccHub "My Company"
    $projects = Get-ApsProject -hub $hub
}

Authentication on the Vault Job Processor

For powerJobs Processor workflows:

# Import additional modules from this repository  
foreach ($module in Get-ChildItem "C:\ProgramData\coolOrange\powerAPS" -Name -Filter "*.psm1") {
    Import-Module "C:\ProgramData\coolOrange\powerAPS\$module" -Force
}

# Connect using job submitter's credentials (no browser interaction)
$result = Connect-APS -User $job.SubmittedByAutodeskId
if (-not $result) {
    throw $result.Error
}

# Perform operations using modules from this repository
$projectProperties = GetVaultAccProjectProperties $file._FolderPath
$hub = Get-ApsAccHub $projectProperties["Hub"]

Token Management & Session Persistence

Automatic Token Refresh

The powerAPS module handles token lifecycle automatically:

  • 15-day minimum validity for authenticated sessions
  • Automatic background refresh on API calls
  • Extended validity as long as sessions are used regularly
  • Secure token storage integrated with Vault database

Access Scopes & Permissions

The powerAPS module's Connect-APS cmdlet grants comprehensive access scopes:

data:read data:write data:create data:search viewables:read
bucket:create bucket:read bucket:update bucket:delete  
user-profile:read user:read user:write account:read account:write
code:all openid

This enables the modules in this repository to perform:

  • Full data management operations (CRUD)
  • File upload/download and storage management
  • User and account information retrieval
  • Project and hub administration
  • Search and discovery across all accessible content

Integration Patterns

Job Submission Pattern

# Client-side: Submit job with user context
Add-VaultJob -Name "powerAPS.ACC.Publish.PDF" -Parameters @{
    "FileVersionId" = $file.Id
    "EntityId" = $file.Id  
    "EntityClassId" = $file._EntityTypeID
    "SubmittedByAutodeskId" = $APSConnection.User  # Pass user context
}

# Server-side: Job processor uses submitted user context
Connect-APS -User $job.SubmittedByAutodeskId -ErrorAction Stop
# Job now runs with same permissions as submitting user

Module Overview

The repository contains specialized PowerShell modules organized by APS service area:

Data Management (DM) Modules

Core modules for APS Data Management API:

APS.DM.Hubs.psm1

  • Get-ApsHub: Retrieve available hubs (ACC, BIM 360, Fusion)
  • Get-ApsAccHub: Specifically get ACC hubs
  • Hub enumeration and filtering capabilities

APS.DM.Projects.psm1

  • Get-ApsProject: Access projects within hubs
  • Get-ApsProjectFilesFolder: Locate project file storage areas
  • Project metadata and configuration retrieval

APS.DM.Folders.psm1

  • Get-ApsFolder: Navigate folder hierarchies
  • New-ApsFolder: Create new folders in projects
  • Folder structure management and organization

APS.DM.Items.psm1

  • Get-ApsItem: Retrieve individual files and metadata
  • New-ApsItem: Upload new files to projects
  • Set-ApsItem: Update existing file properties
  • Get-ApsItemVersions: Access file version history
  • Comprehensive file lifecycle management

APS.DM.Buckets.psm1

  • Get-ApsBucket: Access storage buckets
  • New-ApsBucket: Create data storage containers
  • Low-level storage operations and bucket management

Autodesk Construction Cloud (ACC) Modules

Specialized modules for ACC-specific functionality:

APS.ACC.Admin.psm1

  • Project administration and configuration
  • User and permission management
  • ACC-specific project settings and policies

APS.ACC.Assets.psm1

  • Asset and equipment data management
  • ACC model coordination features
  • Asset tracking and lifecycle management

APS.ACC.DM.psm1

  • ACC document management integration
  • Drawing and specification workflows
  • Document review and approval processes

APS.ACC.Issues.psm1

  • Issue tracking and management
  • Quality control workflows
  • Problem reporting and resolution

APS.ACC.Reviews.psm1

  • Design review coordination
  • Markup and comment management
  • Collaborative review processes

APS.ACC.Relationships.psm1

  • File dependency tracking
  • Cross-project relationships
  • Reference and link management

Autodesk User Profile Modules

APS.UserProfile.psm1

  • User authentication and profile management
  • Account information and preferences
  • Session and token management

Shared Vault Modules

Shared.Vault.psm1

Misc functions to wrap common Vault API calls; used by powerEvents and powerJobs


Support and Documentation

For additional information:

About

PowerShell Modules for Autodesk Cloud Integrations

Topics

Resources

License

Stars

Watchers

Forks