Adsk.Platform.VaultData 0.2.8

dotnet add package Adsk.Platform.VaultData --version 0.2.8
                    
NuGet\Install-Package Adsk.Platform.VaultData -Version 0.2.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Adsk.Platform.VaultData" Version="0.2.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Adsk.Platform.VaultData" Version="0.2.8" />
                    
Directory.Packages.props
<PackageReference Include="Adsk.Platform.VaultData" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Adsk.Platform.VaultData --version 0.2.8
                    
#r "nuget: Adsk.Platform.VaultData, 0.2.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Adsk.Platform.VaultData@0.2.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Adsk.Platform.VaultData&version=0.2.8
                    
Install as a Cake Addin
#tool nuget:?package=Adsk.Platform.VaultData&version=0.2.8
                    
Install as a Cake Tool

Autodesk.Vault - Vault Data SDK

A .NET SDK providing a Fluent API for the Autodesk Vault Data APIs, generated from the official OpenAPI specifications using Microsoft Kiota.

Features

This SDK provides access to Vault Data API endpoints through a unified client:

API Description
Sessions Authentication and session management
Vaults Vault operations and management
Files & Folders File versions, folder contents, and file associations
Items Item management, versions, and bill of materials
Change Orders Engineering Change Order (ECO) management
Users User account management
Groups Group management
Roles Role management
Server Info Server information retrieval
System Options System-level options
Profile Attributes User profile attribute definitions
Search Basic and advanced search operations
Jobs Job management and monitoring
Links Entity link management
Properties Property definitions

Installation

dotnet add package Adsk.Platform.VaultData

Quick Start

Using with 2-Legged Authentication (Server-to-Server)

For server-to-server communication using client credentials (2-legged OAuth) with user impersonation:

using Autodesk.Vault;
using Autodesk.Authentication;
using Autodesk.Authentication.Helpers.Models;

// Your APS app credentials
var clientId = "YOUR_CLIENT_ID";
var clientSecret = "YOUR_CLIENT_SECRET";

// Define the required scopes
var scopes = new[] { "data:read", "data:write" };

// Create authentication client
var authClient = new AuthenticationClient();

// Create an auto-refreshing token provider
var tokenStore = new InMemoryTokenStore();
var getAccessToken = authClient.Helper.CreateTwoLeggedAutoRefreshToken(
    clientId, 
    clientSecret, 
    scopes, 
    tokenStore);

// Initialize the Vault client with 2-legged auth
// The userId parameter specifies the Vault user to impersonate
var vaultClient = new VaultClient(
    getAccessToken, 
    vaultServer: "your-vault-server.autodesk.com", 
    userId: "user@company.com");

Using with 3-Legged Authentication (User Context)

For user-context operations using 3-legged OAuth:

using Autodesk.Vault;

// Function that returns the 3-legged access token
Func<Task<string>> getAccessToken = () => Task.FromResult("YOUR_3LEGGED_ACCESS_TOKEN");

// Initialize the Vault client with 3-legged auth
var vaultClient = new VaultClient(
    getAccessToken, 
    vaultServer: "your-vault-server.autodesk.com");

Usage Examples

Create a Session

using Autodesk.Vault.Sessions;

// Create session with username/password
var sessionData = new SessionsPostRequestBody
{
    VaultName = "MyVault",
    UserName = "myuser",
    Password = "mypassword"
};

var session = await vaultClient.Auth.CreateSessionAsync(sessionData);
Console.WriteLine($"Session ID: {session?.Id}");

Get Server Information

// Get server information
var serverInfo = await vaultClient.Api.ServerInfo.GetAsync();
Console.WriteLine($"Server Version: {serverInfo?.ServerVersion}");

List Vaults

// Get all vaults
var vaults = await vaultClient.Api.Vaults.GetAsync();

foreach (var vault in vaults?.Data ?? [])
{
    Console.WriteLine($"Vault: {vault.Name} - ID: {vault.Id}");
}

Get Files and Folders

// Get folder contents
var contents = await vaultClient.FilesAndFolders.GetFolderContentsAsync(vaultId, folderId);

foreach (var item in contents?.Data ?? [])
{
    Console.WriteLine($"Item: {item.Name}");
}

// Download file content
var fileStream = await vaultClient.FilesAndFolders.GetFileVersionContentAsync(
    vaultId, 
    fileVersionId);

Work with Items

// Get items in a vault
var items = await vaultClient.Items.GetItemsAsync(vaultId);

foreach (var item in items?.Data ?? [])
{
    Console.WriteLine($"Item: {item.Number} - {item.Title}");
}

// Get item versions
var versions = await vaultClient.Items.GetItemVersionsAsync(vaultId, itemId);

// Get bill of materials for an item version
var bom = await vaultClient.Items.GetBillOfMaterialsAsync(vaultId, itemVersionId);

Search Operations

using Autodesk.Vault.Vaults.WithVaultIdAdvancedSearch;

// Perform advanced search
var searchBody = new WithVaultIdAdvancedSearchPostRequestBody
{
    // Configure your search criteria
};

var results = await vaultClient.Search.PerformAdvancedSearchAsync(vaultId, searchBody);

foreach (var entity in results?.Data ?? [])
{
    Console.WriteLine($"Found: {entity.Name}");
}

Manage Users and Groups

// Get all users
var users = await vaultClient.Accounts.GetUsersAsync();

// Get all groups
var groups = await vaultClient.Accounts.GetGroupsAsync();

// Get user by ID
var user = await vaultClient.Accounts.GetUserByIdAsync(userId);

Using the Full API

For endpoints not available through manager shortcuts, use the Api property to access the full API structure:

// Access the full API for low-level operations
var result = await vaultClient.Api.Vaults[vaultId].Files[fileId].GetAsync();

Manager Reference

The SDK provides convenient manager properties for organized access to API operations:

Property Description
vaultClient.Auth Authentication and session management
vaultClient.Accounts Users, Groups, Roles, Profile Attributes
vaultClient.Options System Options, Vault Options
vaultClient.Informational Server Info, Vaults
vaultClient.Properties Property definitions
vaultClient.FilesAndFolders Files, File Versions, Folders, Associations
vaultClient.Items Items, Item Versions, Bill of Materials
vaultClient.ChangeOrders Engineering Change Orders (ECOs)
vaultClient.Links Entity links and relationships
vaultClient.Search Basic and advanced search
vaultClient.Jobs Job management and status

API Structure

The Api property provides direct access to the generated Kiota client:

Property Description
vaultClient.Api.Sessions Session management endpoints
vaultClient.Api.Vaults Vault and vault content endpoints
vaultClient.Api.Users User management endpoints
vaultClient.Api.Groups Group management endpoints
vaultClient.Api.Roles Role management endpoints
vaultClient.Api.ServerInfo Server information endpoint
vaultClient.Api.SystemOptions System options endpoints
vaultClient.Api.ProfileAttributeDefinitions Profile attribute endpoints

Custom HttpClient

You can provide your own HttpClient instance for advanced scenarios:

var httpClient = new HttpClient();
// Configure your HttpClient (timeouts, handlers, etc.)

var vaultClient = new VaultClient(getAccessToken, vaultServer, userId, httpClient);

Rate Limiting

The SDK handles API rate limits automatically thanks to the built-in retry handler provided by the Kiota HTTP client. When the API returns a 429 Too Many Requests response, the SDK will:

  • Automatically retry the request with exponential backoff
  • Respect the Retry-After header returned by the API
  • Retry up to a configurable number of times before failing

This means you don't need to implement custom retry logic in your application — the SDK handles transient failures and rate limiting transparently.

Error Handling

By default, the SDK throws an HttpRequestException for any non-successful HTTP response (4xx or 5xx status codes). This differs from Kiota's default behavior, which requires you to check the response status manually.

The exception includes:

  • The request URI
  • The HTTP status code
  • The full HttpResponseMessage in the Data["context"] property, allowing you to inspect the request, headers, response body, and other details for debugging
try
{
    var items = await vaultClient.Items.GetItemsAsync(vaultId);
}
catch (HttpRequestException ex)
{
    Console.WriteLine($"Request failed: {ex.Message}");
    Console.WriteLine($"Status code: {ex.StatusCode}");

    // Access the full response for more details
    if (ex.Data["context"] is HttpResponseMessage response)
    {
        // Get request details
        Console.WriteLine($"Request URI: {response.RequestMessage?.RequestUri}");
        Console.WriteLine($"Request Method: {response.RequestMessage?.Method}");

        // Get response body
        var body = await response.Content.ReadAsStringAsync();
        Console.WriteLine($"Response body: {body}");
    }
}

If you prefer Kiota's default behavior (no automatic exception throwing), you can disable the error handler:

using Autodesk.Common.HttpClientLibrary.Middleware.Options;

// Disable error handling for a specific request
var requestConfig = new Action<RequestConfiguration<DefaultQueryParameters>>(config =>
{
    config.Options.Add(new ErrorHandlerOption { Enabled = false });
});

var items = await vaultClient.Items.GetItemsAsync(vaultId, requestConfig);

Requirements

  • .NET 8.0 or later
  • Valid Autodesk Platform Services (APS) access token with appropriate scopes
  • Access to an Autodesk Vault server

Documentation

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.8 31 2/9/2026