If the set of available powerFLC cmdlets do not cover all needs you can use the Fusion Lifecycle REST API


Using the REST API

In a PowerShell script you can use the Connect-FLC cmdlet to connect to Fusion Lifecycle with your credentials.

When using a custom workflow in powerJobs Processor the Fusion Lifecycle information can be retrieved using $tentant and $workflow as described in this article.

Import-Module powerFLC
$connected = Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com'


After successfully connecting to Fusion Lifecycle you can use Invoke-RestMethod to communicate with Fusion Lifecycle by using the information provided by the $flcConnection variable.

This variable also handles refreshing the access token automatically. This token is required for all our next requests to the Fusion Lifecycle REST APIs.


This example gets a maximum of 50 Workspaces from the Fusion Lifecycle Workspace v3 API:

$workspaces = Invoke-RestMethod -Uri "$($flcConnection.Url)api/v3/workspaces?limit=50" -Method Get -Headers @{
    "Accept" = "application/json"
    "Authorization" = $flcConnection.AuthenticationToken
    "X-user-id" = $flcConnection.UserId
    "X-Tenant" = $flcConnection.Tenant
}

The result from the workspaces Endpoint can directly be consumed in the PowerShell script afterwards.

Following example prints all the available Workspace titles and their links to the console:

$workspaces.items | Format-Table title,link
<#
title                                   link
-----                                   ----
BOM_Support                             /api/v3/workspaces/82
Products                                /api/v3/workspaces/47
Tasks                                   /api/v3/workspaces/2
Items and BOMs                          /api/v3/workspaces/57
Documents                               /api/v3/workspaces/71
Design Review                           /api/v3/workspaces/69
Problem Report                          /api/v3/workspaces/54
Change Request                          /api/v3/workspaces/26
Change Orders                           /api/v3/workspaces/9
Document Change Order                   /api/v3/workspaces/70
Deviation and Waiver Requests           /api/v3/workspaces/53
Suppliers                               /api/v3/workspaces/14
Audits                                  /api/v3/workspaces/22
SQBR Supplier Quarterly Business Review /api/v3/workspaces/73
Customers                               /api/v3/workspaces/5
Non Conformances                        /api/v3/workspaces/19
Corrective / Preventative Actions       /api/v3/workspaces/20
Return Merchandise Authorization        /api/v3/workspaces/31
FMEA Analysis                           /api/v3/workspaces/68
SCAR Supplier Corrective Action Request /api/v3/workspaces/72
Training                                /api/v3/workspaces/74
Approval Lists                          /api/v3/workspaces/64
Project Task Template                   /api/v3/workspaces/67
Document Description Generator          /api/v3/workspaces/75
Item Description Generator              /api/v3/workspaces/65
Product Description Generator           /api/v3/workspaces/66
#>

Some more Resource Endpoints can be found here in the REST API v3 Reference (or in the REST API v1 Reference).


By using powerJobs Processor you can automate your new custom workflow directly on the Job Processor by simply creating a custom job out of the previous PowerShell script. 

The job can be configured to be added to the Job Queue for the required Vault Lifecycle transitions.


See Also

powerFLC (coolOrange wiki)

Create a powerJobs Processor Job (coolOrange wiki)

Fusion Lifecycle documentation (Autodesk)